|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlapisx.util.PriorityQueue
Priority queue. Objects stored in a priority queue must implement the Prioritized interface.
Constructor Summary | |
PriorityQueue()
Make an empty PriorityQueue. |
|
PriorityQueue(int initialCapacity)
Make an empty PriorityQueue with an initial capacity. |
Method Summary | |
void |
clear()
Remove all objects from queue. |
boolean |
delete(Prioritized x)
Delete an object from queue. |
Object |
deleteMin()
Get and delete the object with lowest priority. |
static void |
dump(PriorityQueue q)
|
Enumeration |
elements()
Enumerate the objects in the queue, in no particular order |
boolean |
empty()
Test whether queue is empty. |
Object |
getMin()
Get object with lowest priority from queue. |
static void |
main(String[] args)
|
void |
put(Prioritized x)
Put an object on the queue. |
int |
size()
Get number of objects in queue. |
void |
update()
Rebuild priority queuein case the priorities of its elements have changed since they were inserted. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PriorityQueue()
public PriorityQueue(int initialCapacity)
initialCapacity
- number of elements initially allocated in queueMethod Detail |
public void put(Prioritized x)
x
- object to put on the queuepublic Object getMin()
public Object deleteMin()
public boolean delete(Prioritized x)
x
- object to delete
public void clear()
public Enumeration elements()
public int size()
public boolean empty()
public void update()
public static void main(String[] args)
public static void dump(PriorityQueue q)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |