Package it.unimi.dsi.fastutil.longs
Interface LongIterator
- All Superinterfaces:
Iterator<Long>
,PrimitiveIterator<Long,LongConsumer>
,PrimitiveIterator.OfLong
- All Known Subinterfaces:
LongBidirectionalIterator
,LongBigListIterator
,LongListIterator
- All Known Implementing Classes:
AbstractLongBidirectionalIterator
,AbstractLongBigListIterator
,AbstractLongIterator
,AbstractLongListIterator
,LongBigListIterators.BigListIteratorListIterator
,LongBigListIterators.EmptyBigListIterator
,LongBigListIterators.UnmodifiableBigListIterator
,LongIterators.EmptyIterator
,LongIterators.UnmodifiableBidirectionalIterator
,LongIterators.UnmodifiableIterator
,LongIterators.UnmodifiableListIterator
public interface LongIterator extends PrimitiveIterator.OfLong
A type-specific
Iterator
; provides an additional method to avoid
(un)boxing, and the possibility to skip elements.- See Also:
Iterator
-
Nested Class Summary
Nested classes/interfaces inherited from interface java.util.PrimitiveIterator
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
-
Method Summary
Modifier and Type Method Description default void
forEachRemaining(Consumer<? super Long> action)
Deprecated.Please use the corresponding type-specific method instead.default Long
next()
Deprecated.Please use the corresponding type-specific method instead.long
nextLong()
Returns the next element as a primitive type.default int
skip(int n)
Skips the given number of elements.Methods inherited from interface java.util.PrimitiveIterator.OfLong
forEachRemaining
-
Method Details
-
nextLong
long nextLong()Returns the next element as a primitive type.- Specified by:
nextLong
in interfacePrimitiveIterator.OfLong
- Returns:
- the next element in the iteration.
- See Also:
Iterator.next()
-
next
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
next
in interfaceIterator<Long>
- Specified by:
next
in interfacePrimitiveIterator.OfLong
-
forEachRemaining
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
forEachRemaining
in interfaceIterator<Long>
- Specified by:
forEachRemaining
in interfacePrimitiveIterator.OfLong
-
skip
default int skip(int n)Skips the given number of elements.The effect of this call is exactly the same as that of calling
next()
forn
times (possibly stopping ifIterator.hasNext()
becomes false).- Parameters:
n
- the number of elements to skip.- Returns:
- the number of elements actually skipped.
- See Also:
Iterator.next()
-