gshute.util
Interface PriorityQueue

All Known Implementing Classes:
ListPriorityQueue

public abstract interface PriorityQueue

A PriorityQueue is an explicit priority version of a prioritized dispenser.


Method Summary
 void add(java.lang.Object dat, java.lang.Object pri)
          pq.add(dat, pri) adds dat to pq with priority pri.
 void clear()
          pq.clear() removes all entries from pq.
 java.lang.Object data()
          pq.data() returns the highest priority data in pq.
 java.util.Iterator iterator()
          pq.iterator() returns an iterator for the entries of pq.
 boolean more()
          pq.more() returns true if there are more entries in pq.
 java.lang.Object priority()
          pq.priority() returns the priority of the highest priority entry in pq.
 void remove()
          pq.remove() removes the highest priority entry from pq.
 int size()
          pq.size() returns the number of entries in pq.
 

Method Detail

more

public boolean more()
pq.more() returns true if there are more entries in pq.

size

public int size()
pq.size() returns the number of entries in pq.

add

public void add(java.lang.Object dat,
                java.lang.Object pri)
pq.add(dat, pri) adds dat to pq with priority pri.

data

public java.lang.Object data()
pq.data() returns the highest priority data in pq.

Precondition: pq.more() is true


priority

public java.lang.Object priority()
pq.priority() returns the priority of the highest priority entry in pq.

Precondition: pq.more() is true


remove

public void remove()
pq.remove() removes the highest priority entry from pq.

Precondition: pq.more() is true


clear

public void clear()
pq.clear() removes all entries from pq.

iterator

public java.util.Iterator iterator()
pq.iterator() returns an iterator for the entries of pq.