public abstract class AbstractIterator<T>
extends java.lang.Object
implements java.util.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
|
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
public boolean hasNext()
hasNext in interface java.util.Iterator<T>protected void setNext(T value)
protected void done()
Copyright © 2024. All rights reserved.