|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Interface for a priority queue.
A priority queue defines a total order relation, usually induced by a comparator. A priority queue stores a collection of items (each of which is a key-element pair); it supports the insertion of items whose key in the domain of the total order relation, and the access and removal of items with smallest key.
This interface in the "simple" package defines only the basic methods of a priority queue.
EmptyContainerException,
InvalidKeyException,
Comparator,
PriorityQueue| Method Summary | |
void |
insertItem(java.lang.Object key,
java.lang.Object element)
Insert an item (key-element pair). |
java.lang.Object |
minElement()
Inspect an element (not a key) with smallest key, without modifying the priority queue. |
java.lang.Object |
minKey()
Inspect a smallest key (not its element), without modifying the priority queue. |
java.lang.Object |
removeMinElement()
Remove an item (key,element) with smallest key. |
| Methods inherited from interface jdsl.simple.api.SimpleContainer |
isEmpty,
size |
| Method Detail |
public java.lang.Object minElement()
throws EmptyContainerException
public java.lang.Object minKey()
throws EmptyContainerException
public void insertItem(java.lang.Object key,
java.lang.Object element)
throws InvalidKeyException
key - object.element - arbitrary object.
public java.lang.Object removeMinElement()
throws EmptyContainerException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||