Iterator over an array of objects.
This iterator does not support remove, as the object array cannot be
structurally modified.
The iterator implements a reset method, allowing the reset of the iterator
back to the start if required.
| Modifier and Type | Field and Description |
|---|---|
| pack-priv final E[] | array
The array |
| pack-priv final int | endIndex
The end index to loop to |
| pack-priv int | index
The current iterator index |
| pack-priv final int | startIndex
The start index to loop from |
| Access | Constructor and Description |
|---|---|
| public | ObjectArrayIterator(final E...
the array to iterate over array)Constructs an ObjectArrayIterator that will iterate over the values in the specified array. |
| public | ObjectArrayIterator(final E[]
the array to iterate over array, final int the index to start iterating at start)Constructs an ObjectArrayIterator that will iterate over the values in the specified array from a specific start index. |
| public | ObjectArrayIterator(final E[]
the array to iterate over array, final int the index to start iterating at start, final int the index (exclusive) to finish iterating at end)Construct an ObjectArrayIterator that will iterate over a range of values in the specified array. |
| Modifier and Type | Method and Description |
|---|---|
| public E[] | Returns: the array this iterator iterates overGets the array that this iterator is iterating over. |
| public int | |
| public int | |
| public boolean | Returns: true if there is a next element to returnImplements java. |
| public E | Returns: the next element in the arrayImplements java. |
| public void | |
| public void | reset()
Implements org. |
| array | back to summary |
|---|---|
| pack-priv final E[] array The array | |
| endIndex | back to summary |
|---|---|
| pack-priv final int endIndex The end index to loop to | |
| index | back to summary |
|---|---|
| pack-priv int index The current iterator index | |
| startIndex | back to summary |
|---|---|
| pack-priv final int startIndex The start index to loop from | |
| ObjectArrayIterator | back to summary |
|---|---|
| public ObjectArrayIterator(final E... array) Constructs an ObjectArrayIterator that will iterate over the values in the specified array.
| |
| ObjectArrayIterator | back to summary |
|---|---|
| public ObjectArrayIterator(final E[] array, final int start) Constructs an ObjectArrayIterator that will iterate over the values in the specified array from a specific start index.
| |
| ObjectArrayIterator | back to summary |
|---|---|
| public ObjectArrayIterator(final E[] array, final int start, final int end) Construct an ObjectArrayIterator that will iterate over a range of values in the specified array.
| |
| getArray | back to summary |
|---|---|
| public E[] getArray() Gets the array that this iterator is iterating over.
| |
| getEndIndex | back to summary |
|---|---|
| public int getEndIndex() Gets the end index to loop to.
| |
| getStartIndex | back to summary |
|---|---|
| public int getStartIndex() Gets the start index to loop from.
| |
| hasNext | back to summary |
|---|---|
| public boolean hasNext() Implements java. Returns true if there are more elements to return from the array.
| |
| next | back to summary |
|---|---|
| public E next() Implements java. Returns the next element in the array.
| |
| remove | back to summary |
|---|---|
| public void remove() Overrides default java. Throws
| |
| reset | back to summary |
|---|---|
| public void reset() Implements org. Resets the iterator back to the start index.
| |