public abstract class AbstractIterator<T> extends Object implements Iterator<T>
Constructor and Description |
---|
AbstractIterator() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
computeNext()
Computes the next item in the iterator.
|
protected void |
done()
Sets the state to done so that the iteration terminates.
|
boolean |
hasNext() |
T |
next() |
protected void |
setNext(T value)
Sets the next value in the iteration, called from the [computeNext] function
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining, remove
protected abstract void computeNext()
This callback method should call one of these two methods:
* [setNext] with the next value of the iteration * [done] to indicate there are no more elements
Failure to call either method will result in the iteration terminating with a failed state
protected void setNext(T value)
protected void done()
Copyright © 2024. All rights reserved.