Class LinkedBlockingDeque.AbstractItr
java.lang.Object
org.datanucleus.store.rdbms.datasource.dbcp2.pool2.impl.LinkedBlockingDeque.AbstractItr
- All Implemented Interfaces:
Iterator<E>
- Direct Known Subclasses:
LinkedBlockingDeque.DescendingItr, LinkedBlockingDeque.Itr
- Enclosing class:
LinkedBlockingDeque<E>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate LinkedBlockingDeque.Node<E> Node returned by most recent call to next.(package private) LinkedBlockingDeque.Node<E> The next node to return in next()(package private) EnextItem 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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidadvance()Advances next.(package private) abstract LinkedBlockingDeque.Node<E> Obtain the first node to be returned by the iterator.booleanhasNext()next()(package private) abstract LinkedBlockingDeque.Node<E> For a given node, obtain the next node to be returned by the iterator.voidremove()private LinkedBlockingDeque.Node<E> Returns the successor node of the given non-null, but possibly previously deleted, node.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Iterator
forEachRemaining
-
Field Details
-
next
LinkedBlockingDeque.Node<E> nextThe next node to return in next() -
nextItem
E nextItemnextItem 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. -
lastRet
Node returned by most recent call to next. Needed by remove. Reset to null if this element is deleted by a call to remove.
-
-
Constructor Details
-
AbstractItr
AbstractItr()Create a new iterator. Sets the initial position.
-
-
Method Details
-
firstNode
Obtain the first node to be returned by the iterator.- Returns:
- first node
-
nextNode
For a given node, obtain the next node to be returned by the iterator.- Parameters:
n- given node- Returns:
- next node
-
succ
Returns the successor node of the given non-null, but possibly previously deleted, node.- Parameters:
n- node whose successor is sought- Returns:
- successor node
-
advance
void advance()Advances next. -
hasNext
-
next
-
remove
-