private class DynamicList.DynamicListIterator extends DynamicCollection.DynamicIterator implements java.util.ListIterator<E>
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.Boolean |
hasPrevious
Iterator variable - not thread-safe/synchronized since only one
thread should use the iterator.
|
protected E |
headGhost
Similar to
DynamicIterator#tailGhost in functionality but
representing the last seen object in the head of the collection. |
private boolean |
previousOperationCalled
Boolean field used by the
set(Object) and DynamicCollection.DynamicIterator.remove()
operation. |
cursor, hasNext, lock, removalAllowed, tailGhost| Modifier | Constructor and Description |
|---|---|
private |
DynamicListIterator(int index) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(E o) |
boolean |
hasPrevious() |
E |
next() |
int |
nextIndex() |
E |
previous() |
int |
previousIndex() |
protected int |
removalIndex(int cursor) |
void |
set(E o) |
private boolean |
unsafeHasPrevious()
Updates the hasPrevious field.
|
hasNext, remove, removeObject, unsafeHasNextprotected volatile E headGhost
DynamicIterator#tailGhost in functionality but
representing the last seen object in the head of the collection.protected java.lang.Boolean hasPrevious
private boolean previousOperationCalled
set(Object) and DynamicCollection.DynamicIterator.remove()
operation. True indicates next() was called, and false previous().private boolean unsafeHasPrevious()
public boolean hasPrevious()
hasPrevious in interface java.util.ListIterator<E>public int nextIndex()
nextIndex in interface java.util.ListIterator<E>public E next()
next in interface java.util.Iterator<E>next in interface java.util.ListIterator<E>next in class DynamicCollection.DynamicIteratorpublic int previousIndex()
previousIndex in interface java.util.ListIterator<E>protected int removalIndex(int cursor)
removalIndex in class DynamicCollection.DynamicIterator