|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.jsort.queue.PriorityQueue
public final class PriorityQueue
The priority queue keeps the queue ordered by the "priority" of its elements.
The priority is defined by the comparison of each element with the relation of other elements (i.e. using the Comparable or Comparator interface).
Instances of this class are threadsafe.
| Constructor Summary | |
|---|---|
PriorityQueue()
Create a PriorityQueue that its elements will be instances of Comparable. |
|
PriorityQueue(java.util.Collection elements)
Create a PriorityQueue that its elements will be instances of Comparable. |
|
PriorityQueue(java.util.Comparator comparator)
Create an empty PriorityQueue. |
|
PriorityQueue(java.util.Comparator comparator,
java.util.Collection elements)
Create an already populated PriorityQueue. |
|
| Method Summary | |
|---|---|
void |
insert(java.lang.Object newElement)
Insert the new element at queue. |
boolean |
isEmpty()
|
java.lang.Object |
remove()
Take a element from queue. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PriorityQueue()
public PriorityQueue(java.util.Collection elements)
public PriorityQueue(java.util.Comparator comparator)
comparator - the priority calculation element
public PriorityQueue(java.util.Comparator comparator,
java.util.Collection elements)
comparator - the priority calculation element| Method Detail |
|---|
public void insert(java.lang.Object newElement)
Queue
insert in interface Queuepublic java.lang.Object remove()
Queue
remove in interface Queuepublic boolean isEmpty()
isEmpty in interface Queue
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||