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>

private abstract class LinkedBlockingDeque.AbstractItr extends Object implements Iterator<E>
Base class for Iterators for LinkedBlockingDeque
  • Field Details

    • next

      The next node to return in next()
    • nextItem

      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.
    • lastRet

      private LinkedBlockingDeque.Node<E> 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

      abstract LinkedBlockingDeque.Node<E> 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

      public boolean hasNext()
      Specified by:
      hasNext in interface Iterator<E>
    • next

      public E next()
      Specified by:
      next in interface Iterator<E>
    • remove

      public void remove()
      Specified by:
      remove in interface Iterator<E>