public final class IntegerArrayIterator extends Object implements Iterator<Integer>
IntegerArrayIterator is an Iterator that iterates over a
given int[].
Calling remove() sets the array to 0
at the index that corresponds to the last value returned by
next().
| Constructor and Description |
|---|
IntegerArrayIterator(int[] values)
Creates a new IntegerArrayIterator that iterates over the
given
int[]. |
IntegerArrayIterator(int[] values,
int replacement)
Creates a new IntegerArrayIterator that iterates over the
given
int[]. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
Integer |
next() |
void |
remove() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic IntegerArrayIterator(int[] values)
int[].
If the given int[] is null, the new
IntegerArrayIterator will behave, as if an empty int[]
has been given.
values - The int[] to iterate over.public IntegerArrayIterator(int[] values,
int replacement)
int[].
If the given int[] is null, the new
IntegerArrayIterator will behave, as if an empty int[]
has been given.
values - The int[] to iterate over.replacement - The value to replace removed values with.Copyright © 2015–2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.