private abstract class LinkedBlockingDeque.AbstractItr
extends java.lang.Object
implements java.util.Iterator<E>
| Modifier and Type | Field and Description |
|---|---|
private LinkedBlockingDeque.Node<E> |
lastRet
Node returned by most recent call to next.
|
(package private) LinkedBlockingDeque.Node<E> |
next
The next node to return in next()
|
(package private) E |
nextItem
nextItem holds on to item fields because once we claim that
an element exists in hasNext(), we must return item read
under lock (in advance()) even if it was in the process of
being removed when hasNext() was called.
|
| Constructor and Description |
|---|
AbstractItr()
Create a new iterator.
|
| Modifier and Type | Method and Description |
|---|---|
(package private) void |
advance()
Advances next.
|
(package private) abstract LinkedBlockingDeque.Node<E> |
firstNode()
Obtain the first node to be returned by the iterator.
|
boolean |
hasNext() |
E |
next() |
(package private) abstract LinkedBlockingDeque.Node<E> |
nextNode(LinkedBlockingDeque.Node<E> n)
For a given node, obtain the next node to be returned by the
iterator.
|
void |
remove() |
private LinkedBlockingDeque.Node<E> |
succ(LinkedBlockingDeque.Node<E> n)
Returns the successor node of the given non-null, but
possibly previously deleted, node.
|
LinkedBlockingDeque.Node<E> next
E nextItem
private LinkedBlockingDeque.Node<E> lastRet
abstract LinkedBlockingDeque.Node<E> firstNode()
abstract LinkedBlockingDeque.Node<E> nextNode(LinkedBlockingDeque.Node<E> n)
n - given nodeprivate LinkedBlockingDeque.Node<E> succ(LinkedBlockingDeque.Node<E> n)
n - node whose successor is soughtvoid advance()
public boolean hasNext()
hasNext in interface java.util.Iterator<E>public void remove()
remove in interface java.util.Iterator<E>