T - generic parameter for this iterator instance: this iterator implements Iterator<T>InnerT - generic parameter of the wrapped iterator, must be T or extend Tpublic abstract class FilterIterator<T,InnerT extends T>
extends java.lang.Object
implements java.util.Iterator<T>
Iterator implementation that filters elements with a boolean predicate.predicateFunction(InnerT)| Modifier and Type | Field and Description |
|---|---|
private java.util.Iterator<InnerT> |
iterator |
private T |
next |
private boolean |
nextIsSet |
| Constructor and Description |
|---|
FilterIterator(java.util.Iterator<InnerT> baseIterator) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
T |
next() |
protected abstract boolean |
predicateFunction(InnerT object)
returns true, if this element should be returned by
next(). |
void |
remove() |
private boolean |
setNext() |
private T next
private boolean nextIsSet
public FilterIterator(java.util.Iterator<InnerT> baseIterator)
protected abstract boolean predicateFunction(InnerT object)
next().public final boolean hasNext()
hasNext in interface java.util.Iterator<T>public final void remove()
remove in interface java.util.Iterator<T>private boolean setNext()