|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Interface for priority queues. This interface does not dictate whether it is min or max heap.
Method Summary | |
void |
clear()
Clear all elements from queue. |
void |
insert(Comparable element)
Insert an element into queue. |
boolean |
isEmpty()
Test if queue is empty. |
Comparable |
peek()
Return element on top of heap but don't remove it. |
Comparable |
pop()
Return element on top of heap and remove it. |
Method Detail |
public void clear()
public void insert(Comparable element)
element
- the element to be insertedpublic boolean isEmpty()
public Comparable peek() throws NoSuchElementException
NoSuchElementException
- if isEmpty() == truepublic Comparable pop() throws NoSuchElementException
NoSuchElementException
- if isEmpty() == true
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |