protected class DynamicCollection.DynamicIterator extends Object implements Iterator<E>
Modifier and Type | Field and Description |
---|---|
protected int |
cursor
Cursor pointing to the element that has to be returned by
next() method. |
protected Boolean |
hasNext
Iterator variable - not thread-safe/synchronized since only one
thread should use the iterator.
|
protected Object |
lock
Lock protecting the cursor and tailGhost which might be affected by
the backing collection shrinking.
|
protected boolean |
removalAllowed
Iterator variable - not thread-safe/synchronized since only one
thread should use the iterator.
|
protected E |
tailGhost
Temporary object holder.
|
Modifier | Constructor and Description |
---|---|
protected |
DynamicCollection.DynamicIterator() |
Modifier and Type | Method and Description |
---|---|
boolean |
hasNext() |
E |
next() |
protected int |
removalIndex(int cursor) |
void |
remove() |
protected boolean |
unsafeHasNext()
Updates the hasNext field.
|
protected volatile int cursor
next()
method. This element needs to be synchronized.protected volatile E tailGhost
protected final Object lock
protected Boolean hasNext
protected boolean removalAllowed
Copyright © 2006-2013. All Rights Reserved.