static class TreeList.TreeListIterator extends java.lang.Object implements java.util.ListIterator, OrderedIterator
| Modifier and Type | Field and Description |
|---|---|
protected TreeList.AVLNode |
current
Cache of the last node that was returned by
next()
or previous(). |
protected int |
currentIndex
The index of the last node that was returned.
|
protected int |
expectedModCount
The modification count that the list is expected to have.
|
protected TreeList.AVLNode |
next
Cache of the next node that will be returned by
next(). |
protected int |
nextIndex
The index of the next node to be returned.
|
protected TreeList |
parent
The parent list
|
| Modifier | Constructor and Description |
|---|---|
protected |
TreeListIterator(TreeList parent,
int fromIndex)
Create a ListIterator for a list.
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object 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.
|
java.lang.Object |
next() |
int |
nextIndex() |
java.lang.Object |
previous()
Gets the previous element from the collection.
|
int |
previousIndex() |
void |
remove() |
void |
set(java.lang.Object obj) |
protected final TreeList parent
protected TreeList.AVLNode next
next().protected int nextIndex
protected TreeList.AVLNode current
next()
or previous().protected int currentIndex
protected int expectedModCount
ConcurrentModificationException may be thrown by
the operations.protected TreeListIterator(TreeList parent, int fromIndex) throws java.lang.IndexOutOfBoundsException
parent - the parent listfromIndex - the index to start atjava.lang.IndexOutOfBoundsExceptionprotected void checkModCount()
java.util.ConcurrentModificationException - If the list's modification
count isn't the value that was expected.public boolean hasNext()
hasNext in interface java.util.IteratorhasNext in interface java.util.ListIteratorpublic java.lang.Object next()
next in interface java.util.Iteratornext in interface java.util.ListIteratorpublic boolean hasPrevious()
OrderedIteratorhasPrevious in interface java.util.ListIteratorhasPrevious in interface OrderedIteratortrue if the iterator has a previous elementpublic java.lang.Object previous()
OrderedIteratorprevious in interface java.util.ListIteratorprevious in interface OrderedIteratorpublic int nextIndex()
nextIndex in interface java.util.ListIteratorpublic int previousIndex()
previousIndex in interface java.util.ListIteratorpublic void remove()
remove in interface java.util.Iteratorremove in interface java.util.ListIteratorpublic void set(java.lang.Object obj)
set in interface java.util.ListIteratorpublic void add(java.lang.Object obj)
add in interface java.util.ListIterator