public class ArrayIterator<E>
extends java.lang.Object
implements java.util.Iterator<E>
Iterator
interface
for an array of objects.Modifier and Type | Field and Description |
---|---|
private E[] |
array
The array to iterate.
|
private int |
index
The index of the next element to return.
|
Constructor and Description |
---|
ArrayIterator(E[] array)
Create a new
ArrayIterator object. |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
E |
next() |
void |
remove()
This operation is not supported.
|
private final E[] array
private int index
public ArrayIterator(E[] array)
ArrayIterator
object.array
- Array to set.