Package it.unimi.dsi.fastutil.longs
Interface LongIterator
-
- All Superinterfaces:
java.util.Iterator<java.lang.Long>,java.util.PrimitiveIterator<java.lang.Long,java.util.function.LongConsumer>,java.util.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 java.util.PrimitiveIterator.OfLongA type-specificIterator; provides an additional method to avoid (un)boxing, and the possibility to skip elements.- See Also:
Iterator
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default voidforEachRemaining(java.util.function.Consumer<? super java.lang.Long> action)Deprecated.Please use the corresponding type-specific method instead.default java.lang.Longnext()Deprecated.Please use the corresponding type-specific method instead.longnextLong()Returns the next element as a primitive type.default intskip(int n)Skips the given number of elements.
-
-
-
Method Detail
-
nextLong
long nextLong()
Returns the next element as a primitive type.- Specified by:
nextLongin interfacejava.util.PrimitiveIterator.OfLong- Returns:
- the next element in the iteration.
- See Also:
Iterator.next()
-
next
@Deprecated default java.lang.Long next()
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
nextin interfacejava.util.Iterator<java.lang.Long>- Specified by:
nextin interfacejava.util.PrimitiveIterator.OfLong
-
forEachRemaining
@Deprecated default void forEachRemaining(java.util.function.Consumer<? super java.lang.Long> action)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
forEachRemainingin interfacejava.util.Iterator<java.lang.Long>- Specified by:
forEachRemainingin interfacejava.util.PrimitiveIterator.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()forntimes (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()
-
-