public abstract class PreIndexedContentIterator<T> extends ReadOnlyIterator<T>
Constructor and Description |
---|
PreIndexedContentIterator(int endIndex) |
PreIndexedContentIterator(int startIndex,
int endIndex) |
Modifier and Type | Method and Description |
---|---|
protected abstract T |
elementAt(int index) |
boolean |
hasNext() |
T |
next() |
remove
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEachRemaining
public PreIndexedContentIterator(int endIndex)
endIndex
- The end index, exclusively.public PreIndexedContentIterator(int startIndex, int endIndex)
startIndex
- The first index, inclusivelyendIndex
- The end index, exclusively.public final boolean hasNext()
public final T next()
protected abstract T elementAt(int index)
index
- The index of the element to yield. Guarantied to never
be out of bounds with respect to the start and end indexes.
E.g. if the given start and end indexes are 0 and 4, this
method will be called for each of the indexes 0, 1, 2, and 3.Copyright © 2016. All Rights Reserved.