Class LazyIterator<T>
java.lang.Object
com.googlecode.concurrenttrees.common.LazyIterator<T>
- All Implemented Interfaces:
Iterator<T>
An unmodifiable iterator which computes the next element to return only when it is requested.
This class is inspired by com.google.common.collect.AbstractIterator in Google Guava,
which was written by the Google Guava Authors, in particular by Kevin Bourrillion.
-
Field Details
-
next
T next -
state
LazyIterator.State state
-
-
Constructor Details
-
LazyIterator
public LazyIterator()
-
-
Method Details
-
remove
-
hasNext
-
tryToComputeNext
boolean tryToComputeNext() -
next
-
endOfData
- Returns:
- a dummy value which if returned by the
computeNext()method, signals that there are no more elements to return
-
computeNext
- Returns:
- The next element which the iterator should return, or the result of calling
endOfData()if there are no more elements to return
-