|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | 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(Object element)
Insert an element into queue. |
boolean |
isEmpty()
Test if queue is empty. |
Object |
peek()
Return element on top of heap but don't remove it. |
Object |
pop()
Return element on top of heap and remove it. |
Method Detail |
public void clear()
public void insert(Object element)
element
- the element to be inserted
ClassCastException
- if the specified element
's
type prevents it from being compared to other items in the queue to
determine its relative priority.public boolean isEmpty()
public Object peek() throws NoSuchElementException
NoSuchElementException
- if isEmpty() == true
public Object pop() throws NoSuchElementException
NoSuchElementException
- if isEmpty() == true
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |