public interface IntIterator
extends java.util.PrimitiveIterator.OfInt
Iterator; provides an additional method to avoid
(un)boxing, and the possibility to skip elements.Iterator| Modifier and Type | Method and Description |
|---|---|
default void |
forEachRemaining(java.util.function.Consumer<? super java.lang.Integer> action)
Deprecated.
Please use the corresponding type-specific method instead.
|
default java.lang.Integer |
next()
Deprecated.
Please use the corresponding type-specific method instead.
|
int |
nextInt()
Returns the next element as a primitive type.
|
default int |
skip(int n)
Skips the given number of elements.
|
int nextInt()
nextInt in interface java.util.PrimitiveIterator.OfIntIterator.next()@Deprecated default java.lang.Integer next()
next in interface java.util.Iterator<java.lang.Integer>next in interface java.util.PrimitiveIterator.OfInt@Deprecated default void forEachRemaining(java.util.function.Consumer<? super java.lang.Integer> action)
forEachRemaining in interface java.util.Iterator<java.lang.Integer>forEachRemaining in interface java.util.PrimitiveIterator.OfIntdefault int skip(int n)
The effect of this call is exactly the same as that of calling
next() for n times (possibly stopping if Iterator.hasNext()
becomes false).
n - the number of elements to skip.Iterator.next()