|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface to iterate over a concurrent list. The class extends the Iterator interface, because the implementation of the concurrent list provides access to the items (containers) of the list as well. Further, an iteration over a concurrent list needs to maintain certain information at each item, which makes an explicit finishing of an iteration necessary (avoids that a threads is delayed until the garbage collector finalizes iterators which are not used any more, but which still block an item.
Iterator
Method Summary | |
void |
finish()
Finishes an iteration. |
ConcurrentItem |
nextItem()
Returns the next item in the list. |
ConcurrentItem |
nextItem(ConcurrentItem item)
Returns the next item and element in the list. |
void |
removeCurrent()
Removes the item currently held by the iterator. |
Methods inherited from interface java.util.Iterator |
hasNext, next, remove |
Method Detail |
public ConcurrentItem nextItem()
public ConcurrentItem nextItem(ConcurrentItem item)
item
- the item where to place the corresponding element, item will
be unchanged if there are no more elements.
public void removeCurrent() throws java.lang.InterruptedException
java.util.NoSuchElementException
- if there is no current item,
i.e., if still none of the next()-methods has
been executed or if the iteration already has completed.
java.lang.InterruptedException
- if the thread is interrupted while
waiting for iterators releasing the current item.public void finish()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |