private class MinMaxPriorityQueue.QueueIterator
extends java.lang.Object
implements java.util.Iterator<E>
If the underlying queue is modified during iteration an exception will be thrown.
| Modifier and Type | Field and Description |
|---|---|
private boolean |
canRemove |
private int |
cursor |
private int |
expectedModCount |
private java.util.Queue<E> |
forgetMeNot |
private E |
lastFromForgetMeNot |
private int |
nextCursor |
private java.util.List<E> |
skipMe |
| Modifier | Constructor and Description |
|---|---|
private |
QueueIterator() |
| Modifier and Type | Method and Description |
|---|---|
private void |
checkModCount() |
private boolean |
foundAndRemovedExactReference(java.lang.Iterable<E> elements,
E target)
Returns true if an exact reference (==) was found and removed from the supplied iterable.
|
boolean |
hasNext() |
E |
next() |
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. |
void |
remove() |
private boolean |
removeExact(java.lang.Object target)
Removes only this exact instance, not others that are equals()
|
private int cursor
private int nextCursor
private int expectedModCount
@CheckForNull private java.util.Queue<E> forgetMeNot
@CheckForNull private java.util.List<E> skipMe
@CheckForNull private E lastFromForgetMeNot
private boolean canRemove
public boolean hasNext()
hasNext in interface java.util.Iterator<E>public void remove()
remove in interface java.util.Iterator<E>private boolean foundAndRemovedExactReference(java.lang.Iterable<E> elements, E target)
private boolean removeExact(java.lang.Object target)
private void checkModCount()
private void nextNotInSkipMe(int c)
c that is not in skipMe and returns size() if there is no such element.