protected static class AbstractLinkedList.LinkedListIterator<E> extends Object implements ListIterator<E>, OrderedIterator<E>
| 限定符和类型 | 字段和说明 |
|---|---|
protected AbstractLinkedList.Node<E> |
current
The last node that was returned by
next() or previous(). |
protected int |
expectedModCount
The modification count that the list is expected to have.
|
protected AbstractLinkedList.Node<E> |
next
The node that will be returned by
next(). |
protected int |
nextIndex
The index of
next. |
protected AbstractLinkedList<E> |
parent
The parent list
|
| 限定符 | 构造器和说明 |
|---|---|
protected |
LinkedListIterator(AbstractLinkedList<E> parent,
int fromIndex)
Create a ListIterator for a list.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
add(E obj) |
protected void |
checkModCount()
Checks the modification count of the list is the value that this
object expects.
|
protected AbstractLinkedList.Node<E> |
getLastNodeReturned()
Gets the last node returned.
|
boolean |
hasNext() |
boolean |
hasPrevious()
Checks to see if there is a previous element that can be iterated to.
|
E |
next() |
int |
nextIndex() |
E |
previous()
Gets the previous element from the container.
|
int |
previousIndex() |
void |
remove() |
void |
set(E obj) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected final AbstractLinkedList<E> parent
protected AbstractLinkedList.Node<E> next
next(). If this is equal
to AbstractLinkedList.header then there are no more values to return.protected int nextIndex
next.protected AbstractLinkedList.Node<E> current
next() or previous(). Set to null if next() or previous() haven't been called, or if the node has been removed
with remove() or a new node added with add(Object).
Should be accessed through getLastNodeReturned() to enforce
this behaviour.protected int expectedModCount
ConcurrentModificationException may be thrown by
the operations.protected LinkedListIterator(AbstractLinkedList<E> parent, int fromIndex) throws IndexOutOfBoundsException
parent - the parent listfromIndex - the index to start atIndexOutOfBoundsException - if fromIndex is less than 0 or greater than the size of the listprotected void checkModCount()
ConcurrentModificationException - If the list's modification
count isn't the value that was expected.protected AbstractLinkedList.Node<E> getLastNodeReturned() throws IllegalStateException
IllegalStateException - If next() or previous() haven't been called,
or if the node has been removed with remove() or a new node added with add(Object).public boolean hasPrevious()
OrderedIteratorhasPrevious 在接口中 OrderedIterator<E>hasPrevious 在接口中 ListIterator<E>true if the iterator has a previous elementpublic E previous()
OrderedIteratorprevious 在接口中 OrderedIterator<E>previous 在接口中 ListIterator<E>public int nextIndex()
nextIndex 在接口中 ListIterator<E>public int previousIndex()
previousIndex 在接口中 ListIterator<E>public void set(E obj)
set 在接口中 ListIterator<E>public void add(E obj)
add 在接口中 ListIterator<E>Copyright © 2022. All rights reserved.