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[] array)
Creates a new IntegerArrayIterator that iterates over the
given
int[]. |
IntegerArrayIterator(int[] array,
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[] array)
throws IllegalArgumentException
int[].
If the given int[] is null, the new
IntegerArrayIterator will behave, as if an empty int[]
has been given.
array - The int[] to iterate over.IllegalArgumentException - If the given int[] is null.public IntegerArrayIterator(int[] array,
int replacement)
throws IllegalArgumentException
int[].
If the given int[] is null, the new
IntegerArrayIterator will behave, as if an empty int[]
has been given.
array - The int[] to iterate over.replacement - The value to replace removed values with.IllegalArgumentException - If the given int[] is null.Copyright © 2015–2016 Markenwerk – Gesellschaft für markenbildende Maßnahmen mbH. All rights reserved.