public interface IntIterator extends Iterator<Integer>, PrimitiveIterator.OfInt
Iterator
<
Integer
>
.
See the comparison of iteration ways in the library.
Iterators of updatable and immutable collections don't support Iterator.remove()
operation. More about mutability profiles.
IntCollection.iterator()
PrimitiveIterator.OfDouble, PrimitiveIterator.OfInt, PrimitiveIterator.OfLong
Modifier and Type | Method and Description |
---|---|
void |
forEachRemaining(Consumer<? super Integer> action)
Deprecated.
Use specialization
forEachRemaining(IntConsumer) instead |
void |
forEachRemaining(IntConsumer action)
Performs the given action for each remaining element until all elements
have been processed or the action throws an exception.
|
int |
nextInt()
Returns the next
int element in the iteration. |
next
int nextInt()
int
element in the iteration. This is a primitive specialization
of the Iterator.next()
method.nextInt
in interface PrimitiveIterator.OfInt
int
element in the iterationNoSuchElementException
- if the iteration has no more elements@Deprecated void forEachRemaining(@Nonnull Consumer<? super Integer> action)
forEachRemaining(IntConsumer)
insteadforEachRemaining
in interface Iterator<Integer>
forEachRemaining
in interface PrimitiveIterator.OfInt
action
- the action to be performed for each elementvoid forEachRemaining(@Nonnull IntConsumer action)
forEachRemaining
in interface PrimitiveIterator<Integer,IntConsumer>
forEachRemaining
in interface PrimitiveIterator.OfInt
action
- the action to be performed for each element