Class MinMaxPriorityQueue.QueueIterator

java.lang.Object
com.google.common.collect.MinMaxPriorityQueue.QueueIterator
All Implemented Interfaces:
Iterator<E>
Enclosing class:
MinMaxPriorityQueue<E>

private class MinMaxPriorityQueue.QueueIterator extends Object implements Iterator<E>
Iterates the elements of the queue in no particular order.

If the underlying queue is modified during iteration an exception will be thrown.

  • Field Details

    • cursor

      private int cursor
    • nextCursor

      private int nextCursor
    • expectedModCount

      private int expectedModCount
    • forgetMeNot

      @CheckForNull private Queue<E> forgetMeNot
    • skipMe

      @CheckForNull private List<E> skipMe
    • lastFromForgetMeNot

      @CheckForNull private E lastFromForgetMeNot
    • canRemove

      private boolean canRemove
  • Constructor Details

    • QueueIterator

      private QueueIterator()
  • Method Details

    • 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>
    • foundAndRemovedExactReference

      private boolean foundAndRemovedExactReference(Iterable<E> elements, E target)
      Returns true if an exact reference (==) was found and removed from the supplied iterable.
    • removeExact

      private boolean removeExact(Object target)
      Removes only this exact instance, not others that are equals()
    • checkModCount

      private void checkModCount()
    • nextNotInSkipMe

      private void nextNotInSkipMe(int c)
      Advances nextCursor to the index of the first element after c that is not in skipMe and returns size() if there is no such element.