|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
E - The type of element in the priority queue.V - The type of values associated with each element.public interface PriorityQueue<E,V extends java.lang.Comparable<V>>
Interface defining priority queue data structure. In this type of structures
each element is associated with a value, method like findMin() can
be used to get the element with the lesser value.
| Method Summary | |
|---|---|
void |
clear()
Make the priority queue logically empty. |
boolean |
contains(E x)
Say if the priority queue contains a given elemeent. |
E |
deleteMin()
Remove the smallest item from the priority queue. |
E |
findMin()
Find the smallest item in the priority queue. |
V |
getValueOf(E element)
Give the value of a given element. |
void |
insert(E x,
V value)
Insert into the priority queue. |
boolean |
isEmpty()
Test if the priority queue is logically empty. |
| Method Detail |
|---|
void insert(E x,
V value)
x - The object to insert.value - The value of the object.
E findMin()
throws java.util.NoSuchElementException
java.util.NoSuchElementException - if the priority queue is empty.
V getValueOf(E element)
throws java.util.NoSuchElementException
element - The element.
java.util.NoSuchElementException - If the priority queue doesn't contains this element.
E deleteMin()
throws java.util.NoSuchElementException
java.util.NoSuchElementException - if the priority queue is empty.void clear()
boolean isEmpty()
boolean contains(E x)
x - The element.
true if the element belong to the priority queue and
false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||