java.lang.Object | +--org.apache.commons.collections.iterators.FilterIteratorAll Implemented Interfaces:
Constructs a new FilterIterator that will not function until #setIterator(Iterator) setIterator is invoked. |
FilterIterator(Iterator iterator) Constructs a new FilterIterator that will not function until #setPredicate(Predicate) setPredicate is invoked. |
FilterIterator(Iterator iterator, Predicate predicate) Constructs a new FilterIterator that will use the given iterator and predicate. |
Iterator | Gets the iterator this iterator is using. |
Gets the predicate this iterator is using. | |
boolean | hasNext() Returns true if the underlying iterator contains an object that matches the predicate. |
Object | next() Returns the next object that matches the predicate. |
void | remove() Removes from the underlying collection of the base iterator the last element returned by this iterator. |
void | setIterator(Iterator iterator) Sets the iterator for this iterator to use. |
void | setPredicate(Predicate predicate) Sets the predicate this the iterator to use. |
public FilterIterator()
FilterIterator
that will not function
until setIterator(Iterator) setIterator is invoked.
public FilterIterator(Iterator iterator, Predicate predicate)
FilterIterator
that will use the
given iterator and predicate.
public FilterIterator(Iterator iterator)
FilterIterator
that will not function
until setPredicate(Predicate) setPredicate is invoked.
public Iterator getIterator()
public Predicate getPredicate()
public boolean hasNext()
public Object next()
- if there are no more elements that
match the predicatepublic void remove()
next()
was called, but not after
hasNext()
, because the hasNext()
call
changes the base iterator.
- if hasNext() has already
been called.public void setIterator(Iterator iterator)
public void setPredicate(Predicate predicate)