public abstract class AbstractIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
| Modifier and Type | Field and Description |
|---|---|
private static int |
AT_END |
private static int |
CACHED |
private E |
nextElement
The next element to be returned from
next() if fetched. |
private static int |
NOT_CACHED |
private int |
state
Current iterator state.
|
| Constructor and Description |
|---|
AbstractIterator() |
| Modifier and Type | Method and Description |
|---|---|
protected E |
done()
Call when done.
|
protected abstract E |
fetch()
Fetch next element.
|
boolean |
hasNext() |
E |
next() |
void |
remove()
Default implementation throws
UnsupportedOperationException. |
private static final int NOT_CACHED
private static final int CACHED
private static final int AT_END
private int state
public boolean hasNext()
hasNext in interface java.util.Iterator<E>public void remove()
UnsupportedOperationException.remove in interface java.util.Iterator<E>protected abstract E fetch()
done() when all
elements have been fetched.done().protected final E done()