public class ArrayIterator
extends java.lang.Object
implements java.util.Iterator, java.io.Serializable, java.lang.Cloneable
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Object[] |
array
Array to iterate over.
|
protected int |
index
The current position in the array.
|
private static long |
serialVersionUID
The serialVersionUID
|
| Constructor and Description |
|---|
ArrayIterator(java.lang.Object[] array)
Construct an ArrayIterator.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
clone()
Returns a shallow cloned copy of this object.
|
boolean |
hasNext()
Returns true if there are more elements in the iteration.
|
java.lang.Object |
next()
Returns the next element in the iteration.
|
void |
remove()
Unsupported.
|
private static final long serialVersionUID
protected final java.lang.Object[] array
protected int index
public ArrayIterator(java.lang.Object[] array)
array - The array to iterate over.public boolean hasNext()
hasNext in interface java.util.Iteratorpublic java.lang.Object next()
next in interface java.util.Iteratorjava.util.NoSuchElementException - The are no more elements available.public void remove()
remove in interface java.util.Iteratorjava.lang.UnsupportedOperationExceptionpublic java.lang.Object clone()
clone in class java.lang.Object