|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.gemini.blueprint.service.importer.support.internal.collection.DynamicCollection.DynamicIterator
protected class DynamicCollection.DynamicIterator
Dynamic consistent iterator. This iterator is not thread-safe with respect to iteration (it should not be shared against multiple threads) but it is thread safe with respect to the backing storage which might be modified during the iterator life cycle.
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
protected |
DynamicCollection.DynamicIterator()
|
Method Summary | |
---|---|
boolean |
hasNext()
|
E |
next()
|
protected int |
removalIndex(int cursor)
|
void |
remove()
|
protected boolean |
unsafeHasNext()
Updates the hasNext field. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
protected DynamicCollection.DynamicIterator()
Method Detail |
---|
public boolean hasNext()
hasNext
in interface Iterator<E>
protected boolean unsafeHasNext()
public E next()
next
in interface Iterator<E>
public void remove()
remove
in interface Iterator<E>
protected int removalIndex(int cursor)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |