Package com.complexible.common.collect
Interface SkippingLongIterator
- All Superinterfaces:
AutoCloseable,CloseableLongIterator,LongIterator,PeekingLongIterator
- All Known Implementing Classes:
AbstractSkippingLongIterator,TransformingLongIterator
Iterator for primitive longs that allows skipping.
- Since:
- 0.7.1
- Author:
- Evren Sirin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longSpecial constant equivalent toLong.MIN_VALUEused to indicate thatskipTo(long)function skipped further then the end of the iterator.Fields inherited from interface com.complexible.common.primitives.LongIterator
NO_NEXT_ELEMENT -
Method Summary
Methods inherited from interface com.complexible.common.primitives.LongIterator
hasNext, nextMethods inherited from interface com.complexible.common.collect.PeekingLongIterator
peek
-
Field Details
-
NOT_FOUND
static final long NOT_FOUNDSpecial constant equivalent toLong.MIN_VALUEused to indicate thatskipTo(long)function skipped further then the end of the iterator.- See Also:
-
-
Method Details
-
skipTo
boolean skipTo(long target) Moves the position to the minimal value that is greater than or equal to the target. Returns true, if such value exists, false otherwise. -
reset
void reset()Resets the iterator to the beginning. -
close
default void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseableLongIterator
-