|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgoldman.collection.AbstractCollection.AbstractLocator<E>
goldman.collection.priority.PairingHeap.Tracker
protected class PairingHeap.Tracker
Field Summary |
---|
Fields inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
versionNumber |
Method Summary | |
---|---|
boolean |
advance()
Moves the tracker to the next element in the iteration order (or {\texttt AFT} if the last element is currently tracked). |
void |
decreasePriority(E element)
Replaces the tracked element by element
REQUIRES: the given parameter is less than e, or that e is the parameter being passed and its value has been mutated to have a lower priority than it had previously. |
E |
get()
Returns the element associated with this locator. |
boolean |
hasNext()
|
boolean |
inCollection()
Returns true if and only if the locator is at an element of the collection. |
void |
increasePriority(E element)
Replaces the tracked element by element
REQUIRES: the given parameter is greater than e, or that e is the parameter being passed and its value has been mutated to have a higher priority than it had previously. |
void |
remove()
Removes the tracked element and updates the tracker to be at the element in the iteration order that preceded the one removed. |
boolean |
retreat()
Moves the tracker to the previous element in the iteration order (or FORE if the first element is currently tracked). |
void |
update(E element)
Replaces the tracked element by element
REQUIRES: element is different than the element
at the current tracker position |
Methods inherited from class goldman.collection.AbstractCollection.AbstractLocator |
---|
checkValidity, ignoreConcurrentModifications, ignorePriorConcurrentModifications, next, updateVersion |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface goldman.collection.Locator |
---|
ignoreConcurrentModifications, ignorePriorConcurrentModifications |
Methods inherited from interface java.util.Iterator |
---|
next |
Method Detail |
---|
public boolean inCollection()
Locator
inCollection
in interface Locator<E>
public E get()
Locator
inCollection
method can be
used to determine if a tracked element is currently in the collection.
If the locator is at FORE or AFT then
a NoSuchElementException
is thrown.
get
in interface Locator<E>
NoSuchElementException
- tracker is not at an element in
the collection.public boolean advance()
advance
in interface Locator<E>
AtBoundaryException
- the tracker is at AFT since there is
no place to advance.public boolean retreat()
retreat
in interface Locator<E>
AtBoundaryException
- the tracker is at FORE since there is
no place to retreat.public boolean hasNext()
hasNext
in interface Iterator<E>
public void remove()
remove
in interface Iterator<E>
NoSuchElementException
- the tracker is at FORE or AFTpublic void update(E element)
element
element
is different than the element
at the current tracker position
update
in interface PriorityQueueLocator<E>
public void increasePriority(E element)
element
increasePriority
in interface PriorityQueueLocator<E>
public void decreasePriority(E element)
element
decreasePriority
in interface PriorityQueueLocator<E>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |