goldman.collection.priority
Interface PriorityQueue<E>

All Superinterfaces:
Collection<E>, Iterable<E>
All Known Implementing Classes:
BinaryHeap, FibonacciHeap, LeftistHeap, PairingHeap

public interface PriorityQueue<E>
extends Collection<E>

A priority queue is an untagged algorithmically positioned collection of comparable elements in which there can be equivalent elements. The primary methods are to add an element, find a maximum priority element, and remove a maximum priority element. In addition, one can remove an element or change the priority of an element through a locator. However, there is no efficient general search method.


Method Summary
 E extractMax()
          Removes and returns a highest priority element.
 PriorityQueueLocator<E> getLocator(E element)
          Returns a priority queue locator that has been set to the given element.
 E max()
          Returns a highest priority element.
 
Methods inherited from interface goldman.collection.Collection
accept, add, addAll, checkRep, clear, contains, ensureCapacity, getCapacity, getComparator, getEquivalentElement, getSize, isEmpty, iterator, remove, retainAll, toArray, toArray, toString, trimToSize
 

Method Detail

extractMax

E extractMax()
Removes and returns a highest priority element. It throws a NoSuchElementException when this collection is empty.


getLocator

PriorityQueueLocator<E> getLocator(E element)
Returns a priority queue locator that has been set to the given element. It throws a NoSuchElementException if there is no equivalent element in this collection.

Specified by:
getLocator in interface Collection<E>

max

E max()
Returns a highest priority element. It throws a NoSuchElementException when this collection is empty.