Interface MarkResetIterator<T>

All Superinterfaces:
AutoCloseable, CloseableIterator<T>, Copyable<MarkResetIterator<T>>, Iterator<T>, ResettableIterator<T>
All Known Subinterfaces:
RestrictedMarkResetIterator<T>
All Known Implementing Classes:
MarkResetSkippingIterator, SpoolingMarkResetIterator

public interface MarkResetIterator<T> extends CloseableIterator<T>, ResettableIterator<T>, Copyable<MarkResetIterator<T>>
An interface to support multiple passes over a specific part of the iterator's output via mark/reset operations. A mark call records the given element and a resetToMark call rewinds the iterator back to the mark.
Since:
8.0
Author:
Pavel Klinov
  • Method Details

    • mark

      void mark(T mark)
      Creates a mark from the provided element.
    • resetToMark

      void resetToMark()
      Rewinds the position of the iterator to the previously marked element.
      Throws:
      NoSuchElementException - if there's no mark
    • empty

      static <T> MarkResetIterator<T> empty()