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 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 interface AutoCloseable
    • createSubIterator

      IteratorFactoryWithBuffer.SubIterator<T,I> createSubIterator(boolean startAtUnbuffered)
      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

      default IteratorFactoryWithBuffer.SubIterator<T,I> subIteratorAtStartOfBuffer()
    • subIteratorAtEndOfBuffer

      default IteratorFactoryWithBuffer.SubIterator<T,I> subIteratorAtEndOfBuffer()