|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.molae.pipe.filter.FilterIterator<E>
public final class FilterIterator<E>
Provides an Iterator that returns only the items that fulfil a specific condition.
| Constructor Summary | |
|---|---|
FilterIterator(Iterator<? extends E> base,
TypedPredicate<? super E> filter)
Constructs a FilterIterator object. |
|
| Method Summary | |
|---|---|
Iterator<? extends E> |
getBase()
Returns the underlying iterator. |
TypedPredicate<? super E> |
getFilter()
Returns the underlying filter. |
boolean |
hasNext()
|
E |
next()
Returns the next element from the base iterator that matches the underlying predicate. |
void |
remove()
Removes from the underlying collection of the base iterator the last element returned by this iterator. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FilterIterator(Iterator<? extends E> base,
TypedPredicate<? super E> filter)
base - base iteratorfilter - a predicate that determines which objects are contained
in the filtered iterator.
NullPointerException - if the specified objects are
null.| Method Detail |
|---|
public Iterator<? extends E> getBase()
public TypedPredicate<? super E> getFilter()
public boolean hasNext()
hasNext in interface Iterator<E>public E next()
next in interface Iterator<E>NoSuchElementException - iteration has no more elements.public void remove()
next() was called, but not after
hasNext(), because the hasNext() call
changes the base iterator.
remove in interface Iterator<E>IllegalStateException - if hasNext() has already
been called.
UnsupportedOperationException - depending on the base iterator
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||