static class TreeList.TreeListIterator<E> extends java.lang.Object implements java.util.ListIterator<E>, OrderedIterator<E>
Modifier and Type | Field and Description |
---|---|
private TreeList.AVLNode<E> |
current
Cache of the last node that was returned by
next()
or previous() . |
private int |
currentIndex
The index of the last node that was returned.
|
private int |
expectedModCount
The modification count that the list is expected to have.
|
private TreeList.AVLNode<E> |
next
Cache of the next node that will be returned by
next() . |
private int |
nextIndex
The index of the next node to be returned.
|
private TreeList<E> |
parent
The parent list
|
Modifier | Constructor and Description |
---|---|
protected |
TreeListIterator(TreeList<E> parent,
int fromIndex)
Create a ListIterator for a list.
|
Modifier and Type | Method and Description |
---|---|
void |
add(E obj) |
protected void |
checkModCount()
Checks the modification count of the list is the value that this
object expects.
|
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) |
private TreeList.AVLNode<E> next
next()
.private int nextIndex
private TreeList.AVLNode<E> current
next()
or previous()
.private int currentIndex
private int expectedModCount
ConcurrentModificationException
may be thrown by
the operations.protected void checkModCount()
java.util.ConcurrentModificationException
- If the list's modification
count isn't the value that was expected.public boolean hasNext()
public E next()
public boolean hasPrevious()
OrderedIterator
hasPrevious
in interface java.util.ListIterator<E>
hasPrevious
in interface OrderedIterator<E>
true
if the iterator has a previous elementpublic E previous()
OrderedIterator
previous
in interface java.util.ListIterator<E>
previous
in interface OrderedIterator<E>
public int nextIndex()
nextIndex
in interface java.util.ListIterator<E>
public int previousIndex()
previousIndex
in interface java.util.ListIterator<E>
public void remove()