|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractList<E>
java.util.ArrayList
blackboard.base.SharableArrayList
blackboard.base.BbList
public class BbList
Generic list class for a collection of objects. While this list can be used
to store any generic set of objects, it can be created such that it enforces
the type of objects that can be added/set within the list. In addition, it
also exposes the filtering functionality provided by ListFilter
.
List
,
Serialized FormNested Class Summary | |
---|---|
class |
BbList.Iterator
A custom extension of FilteringIterator that can be retrieved from
any BbList object using getFilteringIterator()
or getFilteringIterator(ListFilter) . |
Field Summary |
---|
Fields inherited from class java.util.AbstractList |
---|
modCount |
Constructor Summary | |
---|---|
BbList()
Default Constructor. |
|
BbList(java.lang.Class typeClass)
Constructs a BbList designated to only accept objects that are
instances of the object represented by the provided Class value
for addition to the list. |
Method Summary | |
---|---|
void |
add(int index,
java.lang.Object obj)
Overrides add() in parent to enforce type safety of this list. |
boolean |
add(java.lang.Object obj)
Overrides add() in parent to enforce type safety of this list. |
BbList |
getFilteredSubList(ListFilter filter)
Returns a sublist containing only those elements that meet the given filter's requirements. |
BbList.Iterator |
getFilteringIterator()
Returns a BbList.Iterator for this list with no applied filters. |
BbList.Iterator |
getFilteringIterator(ListFilter filter)
Returns a BbList.Iterator for this list with the given filter
applied. |
java.lang.Object |
set(int index,
java.lang.Object obj)
Overrides set() in parent to enforce type safety of this list. |
Methods inherited from class blackboard.base.SharableArrayList |
---|
debug, getSubList, trimList |
Methods inherited from class java.util.ArrayList |
---|
addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, size, toArray, toArray, trimToSize |
Methods inherited from class java.util.AbstractList |
---|
equals, hashCode, iterator, listIterator, listIterator, subList |
Methods inherited from class java.util.AbstractCollection |
---|
containsAll, removeAll, retainAll, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.List |
---|
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList |
Constructor Detail |
---|
public BbList()
public BbList(java.lang.Class typeClass)
BbList
designated to only accept objects that are
instances of the object represented by the provided Class
value
for addition to the list. Any attempt to add objects of a different type
will result in an exception being thrown.
BbList
designed to only contain
object of type Integer
:
BbList list = new BbList( Integer.class ); list.add( new Integer( 1 ) ); <-- successful list.add( new Float( 1.0 ) ); <-- throws IllegalArgumentException
typeClass
- an instance of Class
that represents the type of
object that can be added to the list.Method Detail |
---|
public boolean add(java.lang.Object obj) throws java.lang.IllegalArgumentException
add()
in parent to enforce type safety of this list.
add
in interface java.util.Collection
add
in interface java.util.List
add
in class java.util.ArrayList
obj
- the Object
to add to the list. The provided value
should be of the type provided in the constructor.
java.lang.IllegalArgumentException
- if the element being added is not an
instance of the Class
provided in the constructor.public void add(int index, java.lang.Object obj)
add()
in parent to enforce type safety of this list.
add
in interface java.util.List
add
in class java.util.ArrayList
index
- the index at which the specified element is to be inserted.obj
- the Object
to add to the list. The provided value
should be of the type provided in the constructor.
java.lang.IllegalArgumentException
- if the element being added is not an
instance of the Class
provided in the constructor.public java.lang.Object set(int index, java.lang.Object obj)
set()
in parent to enforce type safety of this list.
set
in interface java.util.List
set
in class java.util.ArrayList
index
- the index at which the specified element is to be set.obj
- the Object
to set in the list. The provided value
should be of the type provided in the constructor.
java.lang.IllegalArgumentException
- if the element being set is not an
instance of the Class
provided in the constructor.public BbList.Iterator getFilteringIterator()
BbList.Iterator
for this list with no applied filters.
Once returned, filters can be added to the iterator using the method FilteringIterator.addFilter(ListFilter)
.
BbList.Iterator
over the elements in this list in proper
sequencepublic BbList.Iterator getFilteringIterator(ListFilter filter)
BbList.Iterator
for this list with the given filter
applied. Once returned, additional filters can be added to the iterator
using the method FilteringIterator.addFilter(ListFilter)
.
filter
- the ListFilter
that should be used to filter values
in this list.
BbList.Iterator
over the elements in this list in proper
sequencepublic BbList getFilteredSubList(ListFilter filter)
filter
- the ListFilter
that should be used to filter values
in this list.
BbList
that does not contain those elements that
did not pass the given filter.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |