Interface IteratorFactoryWithBuffer.SubIterator<T,I extends Iterator<T>>
- All Superinterfaces:
AutoCloseable
,Iterator<T>
,com.google.common.collect.PeekingIterator<T>
- Enclosing class:
- IteratorFactoryWithBuffer<T,
I extends Iterator<T>>
public static interface IteratorFactoryWithBuffer.SubIterator<T,I extends Iterator<T>>
extends com.google.common.collect.PeekingIterator<T>, AutoCloseable
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
createSubIterator
(boolean startAtUnbuffered) Create an iterator with the same next item as this one.long
Return how far this iterator is ahead of the iterator with the lowest offset.long
Should return the absolute offset (starting at 0) of the next item being returned by a call to next(); ISSUE Guava AbstractIterator doesn't allow for checking whether hasNext has been called...default IteratorFactoryWithBuffer.SubIterator<T,
I> default IteratorFactoryWithBuffer.SubIterator<T,
I> Methods inherited from interface java.util.Iterator
forEachRemaining, hasNext
Methods inherited from interface com.google.common.collect.PeekingIterator
next, peek, remove
-
Method Details
-
getDelegate
I getDelegate() -
getOffset
long getOffset()Should return the absolute offset (starting at 0) of the next item being returned by a call to next(); ISSUE Guava AbstractIterator doesn't allow for checking whether hasNext has been called... - so if hasNext was been called then the offset will point to the next element! -
getDistanceToLowestOffset
long getDistanceToLowestOffset()Return how far this iterator is ahead of the iterator with the lowest offset. If there is no other iterator than the distance is 0. This is also the amount of buffering used. -
close
void close()- Specified by:
close
in interfaceAutoCloseable
-
createSubIterator
Create an iterator with the same next item as this one. Items are buffered as long as there exists an open iterator with a lower offset -
subIteratorAtStartOfBuffer
-
subIteratorAtEndOfBuffer
-