|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ConcurrentList.ListItr
Private implementation of the ConcurrentIterator.
Field Summary | |
private ConcurrentItem |
lastReturned
|
Constructor Summary | |
(package private) |
ConcurrentList.ListItr()
Constructs an iterator of the items or elements in the list (in proper sequence), starting at the beginning of the list. |
(package private) |
ConcurrentList.ListItr(int index)
Constructs an iterator of the items or elements in the list (in proper sequence), starting at the given position. |
Method Summary | |
protected void |
finalize()
Adjusts the iterator counter and notifies waiting threads if an iterator goes out of scope and finish() has not been called appropriately. |
void |
finish()
Finishes an iteration. |
boolean |
hasNext()
Indicates whether there is another element after the current position of the iterator. |
java.lang.Object |
next()
Returns the next element in the list. |
ConcurrentItem |
nextItem()
Returns the next item in the list. |
ConcurrentItem |
nextItem(ConcurrentItem item)
Returns the next item and element in the list. |
(package private) ConcurrentItem |
nextItem(java.lang.Object[] elementArray)
Returns the next item and element in the list. |
void |
remove()
The remove method declared by the iterator interface cannot be overwritten directly, because a concurrent iterator might throw an InterruptedException. |
void |
removeCurrent()
Removes the item currently held by the iterator. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private ConcurrentItem lastReturned
Constructor Detail |
ConcurrentList.ListItr()
ConcurrentList.ListItr(int index)
java.lang.IndexOutOfBoundsException
- if index is out of range.Method Detail |
public boolean hasNext()
hasNext
in interface java.util.Iterator
public java.lang.Object next()
next
in interface java.util.Iterator
java.util.NoSuchElementException
- if there are no more elements.public ConcurrentItem nextItem()
nextItem
in interface ConcurrentIterator
ConcurrentItem nextItem(java.lang.Object[] elementArray)
elementArray
- the array will contain the element found,
the array will be unchanged if there are no more elements.
public ConcurrentItem nextItem(ConcurrentItem item)
nextItem
in interface ConcurrentIterator
item
- the item where to place the corresponding element, item will
be unchanged if there are no more elements.
public void remove()
remove
in interface java.util.Iterator
removeCurrent()
public void removeCurrent() throws java.lang.InterruptedException
removeCurrent
in interface ConcurrentIterator
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()
finish
in interface ConcurrentIterator
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
- whatever might be risen by the garbage collector.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |