|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TaggedPriorityQueue<T,E>
The TaggedPriorityQueue ADT is a tagged version of the priority queue ADT. While the comparator used within a priority queue might use a single field of the element (that can be viewed as a tag), in a tagged priority queue there is an explicit association created from the tag to the associated data element. Also, the comparator is required to be based upon only the tags. The tags held within a tagged priority queue need not be unique.
Method Summary | |
---|---|
TaggedElement<T,E> |
extractMax()
Removes and returns a tagged element with a highest priority tag. |
PriorityQueueLocator<TaggedElement<T,E>> |
getLocator(T tag)
Returns a priority queue locator that has been initialized at a tagged element with the given tag. |
Iterator<TaggedElement<T,E>> |
iterator()
Returns an iterator that has been initialized to FORE. |
TaggedElement<T,E> |
max()
Returns a tagged element with a highest priority tag. |
PriorityQueueLocator<TaggedElement<T,E>> |
putTracked(T tag,
E element)
This method creates a new tagged element using the given tag and element, and inserts it into this collection. |
void |
updateTag(T tag,
PriorityQueueLocator<TaggedElement<T,E>> loc)
This method replaces the tag of the tagged element at the given locator position by tag , and makes any required updates
to the underlying data structure. |
Methods inherited from interface goldman.collection.tagged.TaggedCollection |
---|
accept, clear, contains, elements, ensureCapacity, get, getCapacity, getSize, isEmpty, put, putAll, remove, tags, toString, trimToSize, values |
Method Detail |
---|
TaggedElement<T,E> extractMax()
NoSuchElementException
when this collection is empty.
PriorityQueueLocator<TaggedElement<T,E>> getLocator(T tag)
NoSuchElementException
if there is no element in this collection with an equivalent tag.
getLocator
in interface TaggedCollection<T,E>
Iterator<TaggedElement<T,E>> iterator()
iterator
in interface Iterable<TaggedElement<T,E>>
iterator
in interface TaggedCollection<T,E>
TaggedElement<T,E> max()
NoSuchElementException
when this collection is empty.
PriorityQueueLocator<TaggedElement<T,E>> putTracked(T tag, E element)
AtCapacityException
, an unchecked exception, is thrown if the
collection is already at capacity.
void updateTag(T tag, PriorityQueueLocator<TaggedElement<T,E>> loc)
tag
, and makes any required updates
to the underlying data structure.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |