Package com.google.common.collect
Class MinMaxPriorityQueue.QueueIterator
- java.lang.Object
-
- com.google.common.collect.MinMaxPriorityQueue.QueueIterator
-
- All Implemented Interfaces:
java.util.Iterator<E>
- Enclosing class:
- MinMaxPriorityQueue<E>
private class MinMaxPriorityQueue.QueueIterator extends java.lang.Object implements java.util.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 Summary
Fields Modifier and Type Field Description private booleancanRemoveprivate intcursorprivate intexpectedModCountprivate java.util.Queue<E>forgetMeNotprivate ElastFromForgetMeNotprivate intnextCursorprivate java.util.List<E>skipMe
-
Constructor Summary
Constructors Modifier Constructor Description privateQueueIterator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private voidcheckModCount()private booleanfoundAndRemovedExactReference(java.lang.Iterable<E> elements, E target)Returns true if an exact reference (==) was found and removed from the supplied iterable.booleanhasNext()Enext()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(java.lang.Object target)Removes only this exact instance, not others that are equals()
-
-
-
Method Detail
-
hasNext
public boolean hasNext()
- Specified by:
hasNextin interfacejava.util.Iterator<E>
-
remove
public void remove()
- Specified by:
removein interfacejava.util.Iterator<E>
-
foundAndRemovedExactReference
private boolean foundAndRemovedExactReference(java.lang.Iterable<E> elements, E target)
Returns true if an exact reference (==) was found and removed from the supplied iterable.
-
removeExact
private boolean removeExact(java.lang.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 aftercthat is not inskipMeand returnssize()if there is no such element.
-
-