org.apache.commons.collections.iterators
public class FilterIterator extends Object implements Iterator
Since: Commons Collections 1.0
Version: $Revision: 1.8 $ $Date: 2004/02/18 00:59:50 $
| Constructor Summary | |
|---|---|
| FilterIterator()
Constructs a new FilterIterator that will not function
until {@link #setIterator(Iterator) setIterator} is invoked. | |
| FilterIterator(Iterator iterator)
Constructs a new FilterIterator that will not function
until {@link #setPredicate(Predicate) setPredicate} is invoked.
| |
| FilterIterator(Iterator iterator, Predicate predicate)
Constructs a new FilterIterator that will use the
given iterator and predicate.
| |
| Method Summary | |
|---|---|
| Iterator | getIterator()
Gets the iterator this iterator is using.
|
| Predicate | getPredicate()
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.
|
FilterIterator that will not function
until {@link #setIterator(Iterator) setIterator} is invoked.FilterIterator that will not function
until {@link #setPredicate(Predicate) setPredicate} is invoked.
Parameters: iterator the iterator to use
FilterIterator that will use the
given iterator and predicate.
Parameters: iterator the iterator to use predicate the predicate to use
Returns: the iterator.
Returns: the predicate.
Returns: true if there is another object that matches the predicate
Returns: the next object which matches the given predicate
Throws: NoSuchElementException if there are no more elements that match the predicate
next() was called, but not after
hasNext(), because the hasNext() call
changes the base iterator.
Throws: IllegalStateException if hasNext() has already
been called.
Parameters: iterator the iterator to use
Parameters: predicate the transformer to use