|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PriorityQueue
A partially-ordered container that allows for removal of the element with highest priority. The names of the methods (e.g., min()) assume that high priorities are numerically low, but nothing except the names requires this convention.
The interface makes no assumptions about how comparisons are made, or how the elements are ordered. The priority of two elements may be hardcoded or chosen dynamicaly, depending upon the specific implementation.
Note that there is no InspectablePriorityQueue.
Method Summary | |
---|---|
Locator |
min()
Allows access to element with highest priority without removing it from the priority queue. |
java.lang.Object |
removeMin()
Pops the highest-priority element off the priority queue and updates the priority queue. |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.KeyBasedContainer |
---|
insert, remove, replaceKey |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableKeyBasedContainer |
---|
keys, locators |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.Container |
---|
newContainer, replaceElement |
Methods inherited from interface nz.ac.waikato.jdsl.core.api.InspectableContainer |
---|
contains, elements, isEmpty, size |
Method Detail |
---|
Locator min() throws EmptyContainerException
EmptyContainerException
- if the priority queue is emptyjava.lang.Object removeMin() throws EmptyContainerException
EmptyContainerException
- if the priority queue is empty
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |