com.phoenixst.collections
public class FilteredCollection extends AbstractCollection implements Serializable
Collection
which presents a filtered view of
another.
Since: 1.0
Version: $Revision: 1.11 $
Constructor Summary | |
---|---|
FilteredCollection(Collection delegate, Predicate predicate)
Creates a new FilteredCollection . |
Method Summary | |
---|---|
boolean | add(Object object) |
boolean | contains(Object object) |
boolean | isEmpty() |
Iterator | iterator()
Returns an Iterator over the elements of this
Collection . |
boolean | remove(Object object) |
int | size() |
FilteredCollection
. If a
null
Predicate
is passed to this
constructor, TruePredicate is used internally.Iterator
over the elements of this
Collection
. If the remove()
method
is called after hasNext()
without an intervening
call to next()
, the last element returned by
next()
will be removed by calling Collection#remove Collection.remove( object )
on the
underlying Collection
. Depending upon the
underlying Collection
implementation, this may
invalidate this Iterator
.