|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface PriorityQueue<E>
PriorityQueue interface.
Method Summary | |
---|---|
E |
dequeue()
remove the item at the front of the queue (the element with the highest priority that has been there the longest) |
void |
enqueue(E a,
int priority)
insert an item at the back into the queue with a given priority |
E |
examine()
examine the item at the front of the queue (the element with the highest priority that has been in the queue the longest) |
boolean |
isEmpty()
test whether the queue is empty |
Iterator |
iterator()
return a DAT.Iterator to examine all the elements in the PriorityQueue |
Method Detail |
---|
boolean isEmpty()
void enqueue(E a, int priority) throws IllegalValue
a
- the item to insertpriority
- the priority of the element
IllegalValue
- if the priority is not in a valid rangeE examine() throws Underflow
Underflow
- if the queue is emptyE dequeue() throws Underflow
Underflow
- if the queue is emptyIterator iterator()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |