java.lang.Object
org.apache.jena.atlas.iterator.IteratorWithBuffer<T>
- All Implemented Interfaces:
Iterator<T>,IteratorCloseable<T>,Closeable
Iterator that delays output by N slots so you can react to the output before
it's yielded. See also
PeekIterator (which predates this code). See also
IteratorWithHistory for an iterator that remembers what it has yielded.- See Also:
-
Constructor Details
-
IteratorWithBuffer
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
peek
Look at elements that will be returned by a subsequent call of .next(). The next element is index 0, then index 1 etc. This operation is valid immediately after the constructor returns. Returns null for no such element (underlying iterator didn't yield enough elements). Throws IndexOutOfBoundsException if an attempt is made to go beyond the buffering window. -
currentSize
public int currentSize()Return the current size of the lookahead. This can be used to tell the difference between an iterator returning null and an iterator that is just short. -
set
Set the element to be returned by a subsequent .next(). Use with care. The original element to be returned at this position is lost. -
close
public void close()
-