public interface IntIterator extends PrimitiveIterator.OfInt
Iterator; provides an additional method to avoid (un)boxing, and
the possibility to skip elements.IteratorPrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong| Modifier and Type | Method and Description |
|---|---|
default void |
forEachRemaining(Consumer<? super Integer> action)
Deprecated.
Please use the corresponding type-specific method instead.
|
default 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.
|
forEachRemainingint nextInt()
nextInt in interface PrimitiveIterator.OfIntIterator.next()@Deprecated default Integer next()
next in interface Iterator<Integer>next in interface PrimitiveIterator.OfInt@Deprecated default void forEachRemaining(Consumer<? super Integer> action)
forEachRemaining in interface Iterator<Integer>forEachRemaining in interface 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()Copyright © 2020. All rights reserved.