|
RuneHive-Game
|
An Iterator implementation that will iterate over the elements in an array without the overhead of the ArrayLists withdraw operation.
More...
Public Member Functions | |
| ArrayIterator (E[] array) | |
Creates a new ArrayIterator. | |
| boolean | hasNext () |
| E | next () |
| E | peek () |
| void | remove () |
Private Attributes | |
| final E[] | array |
| The array that is storing the elements. | |
| int | index |
| The current index that the iterator is iterating over. | |
| int | lastIndex = -1 |
| The last index that the iterator iterated over. | |
An Iterator implementation that will iterate over the elements in an array without the overhead of the ArrayLists withdraw operation.
| <E> | the type of array being iterated over. |
Definition at line 15 of file ArrayIterator.java.
| com.runehive.util.ArrayIterator< E >.ArrayIterator | ( | E[] | array | ) |
Creates a new ArrayIterator.
| array | the array that is storing the elements. |
Definition at line 36 of file ArrayIterator.java.
References array.
| boolean com.runehive.util.ArrayIterator< E >.hasNext | ( | ) |
Definition at line 41 of file ArrayIterator.java.
| E com.runehive.util.ArrayIterator< E >.next | ( | ) |
| E com.runehive.util.ArrayIterator< E >.peek | ( | ) |
Definition at line 46 of file ArrayIterator.java.
| void com.runehive.util.ArrayIterator< E >.remove | ( | ) |
Definition at line 60 of file ArrayIterator.java.
|
private |
The array that is storing the elements.
Definition at line 20 of file ArrayIterator.java.
Referenced by ArrayIterator(), hasNext(), next(), peek(), and remove().
|
private |
The current index that the iterator is iterating over.
Definition at line 25 of file ArrayIterator.java.
|
private |
The last index that the iterator iterated over.
Definition at line 30 of file ArrayIterator.java.