@GwtCompatible public abstract class AbstractSequentialIterator<T> extends UnmodifiableIterator<T>
Iterator
interface for sequences whose next element can always be derived from the
previous element. Null elements are not supported, nor is the
UnmodifiableIterator.remove() method.
Example:
Iterator<Integer> powersOfTwo =
new AbstractSequentialIterator<Integer>(1) {
protected Integer computeNext(Integer previous) {
return (previous == 1 << 30) ? null : previous * 2;
}
};AbstractLinkedIterator since 8.0)| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
T |
next() |
removeequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic final boolean hasNext()
public final T next()
Copyright © 2010 - 2020 Adobe. All Rights Reserved