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 TypeMethodDescriptionstatic <T> MarkResetIterator<T> empty()voidCreates a mark from the provided element.voidRewinds the position of the iterator to the previously marked element.Methods inherited from interface com.complexible.common.base.CloseableIterator
closeMethods inherited from interface java.util.Iterator
forEachRemaining, hasNext, next, removeMethods inherited from interface com.complexible.common.collect.ResettableIterator
reset
-
Method Details
-
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
-