Package com.google.common.collect
Class MinMaxPriorityQueue.QueueIterator
java.lang.Object
com.google.common.collect.MinMaxPriorityQueue.QueueIterator
- All Implemented Interfaces:
Iterator<E>
- Enclosing class:
- MinMaxPriorityQueue<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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate booleanfoundAndRemovedExactReference(Iterable<E> elements, E target) Returns true if an exact reference (==) was found and removed from the supplied iterable.booleanhasNext()next()private voidnextNotInSkipMe(int c) Advances nextCursor to the index of the first element aftercthat is not inskipMeand returnssize()if there is no such element.voidremove()private booleanremoveExact(Object target) Removes only this exact instance, not others that are equals()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Iterator
forEachRemaining
-
Field Details
-
cursor
private int cursor -
nextCursor
private int nextCursor -
expectedModCount
private int expectedModCount -
forgetMeNot
-
skipMe
-
lastFromForgetMeNot
-
canRemove
private boolean canRemove
-
-
Constructor Details
-
QueueIterator
private QueueIterator()
-
-
Method Details
-
hasNext
public boolean hasNext() -
next
-
remove
public void remove() -
foundAndRemovedExactReference
Returns true if an exact reference (==) was found and removed from the supplied iterable. -
removeExact
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 aftercthat is not inskipMeand returnssize()if there is no such element.
-