Package com.complexible.common.collect

# 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

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface com.complexible.common.base.CloseableIterator

  `CloseableIterator.AbstractCloseableIterator<T>, CloseableIterator.DelegatingCloseableIterator<T>, CloseableIterator.EmptyCloseableIterator<T>`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static <T> MarkResetIterator<T>`
  `empty()`
  `void`
  `mark(T mark)`
  Creates a mark from the provided element.
  `void`
  `resetToMark()`
  Rewinds the position of the iterator to the previously marked element.

  ### Methods inherited from interface com.complexible.common.base.CloseableIterator

  `close`

  ### Methods inherited from interface com.complexible.common.base.Copyable

  `copy`

  ### Methods inherited from interface java.util.Iterator

  `forEachRemaining, hasNext, next, remove`

  ### Methods inherited from interface com.complexible.common.collect.ResettableIterator

  `reset`

- ## 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()