ListIterator interface across a
fixed number of elements that may be retrieved by position. It does not support remove,
set, or add.
| Access | Constructor and Description |
|---|---|
| protected | AbstractIndexedListIterator(int size)
Constructs an iterator across a sequence of the given size whose initial position is 0. |
| protected | AbstractIndexedListIterator(int size, int position)
Constructs an iterator across a sequence of the given size with the given initial position. |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract E | |
| public final boolean | hasNext()
Implements java. true if this list iterator has more elements when
traversing the list in the forward direction.
|
| public final boolean | hasPrevious()
Implements java. true if this list iterator has more elements when
traversing the list in the reverse direction.
|
| public final E | next()
Implements java. |
| public final int | nextIndex()
Implements java. next.
|
| public final E | previous()
Implements java. |
| public final int | previousIndex()
Implements java. previous.
|
| position | back to summary |
|---|---|
| private int position | |
| size | back to summary |
|---|---|
| private final int size | |
| AbstractIndexedListIterator | back to summary |
|---|---|
| protected AbstractIndexedListIterator(int size) Constructs an iterator across a sequence of the given size whose initial position is 0. That
is, the first call to
| |
| AbstractIndexedListIterator | back to summary |
|---|---|
| protected AbstractIndexedListIterator(int size, int position) Constructs an iterator across a sequence of the given size with the given initial position.
That is, the first call to
| |
| get | back to summary |
|---|---|
| protected abstract E get(int index) Returns the element with the specified index. This method is called by
| |
| hasNext | back to summary |
|---|---|
| public final boolean hasNext() Implements java. Doc from java. Returns
| |
| hasPrevious | back to summary |
|---|---|
| public final boolean hasPrevious() Implements java. Doc from java. Returns
| |
| next | back to summary |
|---|---|
| public final E next() Implements java. Doc from java. Returns the next element in the list and advances the cursor position.
This method may be called repeatedly to iterate through the list,
or intermixed with calls to
| |
| nextIndex | back to summary |
|---|---|
| public final int nextIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |
| previous | back to summary |
|---|---|
| public final E previous() Implements java. Doc from java. Returns the previous element in the list and moves the cursor
position backwards. This method may be called repeatedly to
iterate through the list backwards, or intermixed with calls to
| |
| previousIndex | back to summary |
|---|---|
| public final int previousIndex() Implements java. Doc from java. Returns the index of the element that would be returned by a
subsequent call to
| |