|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object
|
+--org.apache.commons.collections.iterators.ProxyIterator
|
+--org.apache.commons.collections.iterators.FilterIterator
A Proxy Iterator which takes a Predicate instance to filter
out objects from an underlying Iterator instance.
Only objects for which the
specified Predicate evaluates to true are
returned.
| Constructor Summary | |
FilterIterator()
Constructs a new FilterIterator that will not function
until setIterator is invoked. |
|
FilterIterator(Iterator iterator)
Constructs a new FilterIterator that will not function
until setPredicate is invoked. |
|
FilterIterator(Iterator iterator,
Predicate predicate)
Constructs a new FilterIterator that will use the
given iterator and predicate. |
|
| Method Summary | |
Predicate |
getPredicate()
Getter for property predicate. |
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()
Always throws UnsupportedOperationException as this class does look-ahead with its internal iterator. |
void |
setPredicate(Predicate predicate)
Setter for property predicate. |
| Methods inherited from class org.apache.commons.collections.iterators.ProxyIterator |
getIterator, setIterator |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public FilterIterator()
FilterIterator that will not function
until setIterator is invoked.public FilterIterator(Iterator iterator)
FilterIterator that will not function
until setPredicate is invoked.iterator - the iterator to use
public FilterIterator(Iterator iterator,
Predicate predicate)
FilterIterator that will use the
given iterator and predicate.iterator - the iterator to usepredicate - the predicate to use| Method Detail |
public Predicate getPredicate()
public boolean hasNext()
hasNext in class ProxyIteratorpublic Object next()
next in class ProxyIteratorNoSuchElementException - if there are no more elements that
match the predicatepublic void remove()
remove in class ProxyIteratorUnsupportedOperationException - alwayspublic void setPredicate(Predicate predicate)
predicate - New value of property predicate.
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||