Package it.unimi.dsi.fastutil.ints
Interface IntIterator
-
- All Superinterfaces:
java.util.Iterator<java.lang.Integer>,java.util.PrimitiveIterator<java.lang.Integer,java.util.function.IntConsumer>,java.util.PrimitiveIterator.OfInt
- All Known Subinterfaces:
IntBidirectionalIterator,IntBigListIterator,IntListIterator
- All Known Implementing Classes:
AbstractIntBidirectionalIterator,AbstractIntBigListIterator,AbstractIntIterator,AbstractIntListIterator,IntBigListIterators.BigListIteratorListIterator,IntBigListIterators.EmptyBigListIterator,IntBigListIterators.UnmodifiableBigListIterator,IntIterators.EmptyIterator,IntIterators.UnmodifiableBidirectionalIterator,IntIterators.UnmodifiableIterator,IntIterators.UnmodifiableListIterator
public interface IntIterator extends java.util.PrimitiveIterator.OfIntA 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.Integer> action)Deprecated.Please use the corresponding type-specific method instead.default java.lang.Integernext()Deprecated.Please use the corresponding type-specific method instead.intnextInt()Returns the next element as a primitive type.default intskip(int n)Skips the given number of elements.
-
-
-
Method Detail
-
nextInt
int nextInt()
Returns the next element as a primitive type.- Specified by:
nextIntin interfacejava.util.PrimitiveIterator.OfInt- Returns:
- the next element in the iteration.
- See Also:
Iterator.next()
-
next
@Deprecated default java.lang.Integer next()
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
nextin interfacejava.util.Iterator<java.lang.Integer>- Specified by:
nextin interfacejava.util.PrimitiveIterator.OfInt
-
forEachRemaining
@Deprecated default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer> action)
Deprecated.Please use the corresponding type-specific method instead.- Specified by:
forEachRemainingin interfacejava.util.Iterator<java.lang.Integer>- Specified by:
forEachRemainingin interfacejava.util.PrimitiveIterator.OfInt
-
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()
-
-