|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbe.ac.ulg.montefiore.run.totem.repository.CSPF.CSPFPriorityQueue
public class CSPFPriorityQueue
Priority Queue used in CSPF
Creation date: 23-Mar.-2004
Field Summary | |
---|---|
protected PriorityQueueObject[] |
heap
|
protected long |
keyComps
|
protected java.util.HashMap<java.lang.String,java.lang.Integer> |
pos
|
protected int |
size
|
Constructor Summary | |
---|---|
CSPFPriorityQueue(int capacity)
Get the object with the minimum key in the queue |
Method Summary | |
---|---|
void |
add(PriorityQueueObject elem)
Adds an object to the queue. |
void |
display()
|
PriorityQueueObject |
getElem(java.lang.String id)
Return the object for the specified id |
long |
getKeyComps()
|
PriorityQueueObject |
next()
Get the object with the minimum key in the queue |
protected void |
remove(PriorityQueueObject elem)
|
PriorityQueueObject |
removeNext()
Removes and returns the next object from the queue |
protected void |
siftup(int p,
int q)
|
int |
size()
Get the size of the queue |
void |
update(PriorityQueueObject elem)
Updates the Object with the same id in the queue Decreases (or increases) the value of elem's key and then performs sift-down (or siftup) until elem has been relocated to the correct position in the binary heap. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PriorityQueueObject[] heap
protected java.util.HashMap<java.lang.String,java.lang.Integer> pos
protected int size
protected long keyComps
Constructor Detail |
---|
public CSPFPriorityQueue(int capacity)
capacity
- the maximum queue capacityMethod Detail |
---|
public PriorityQueueObject next()
next
in interface PriorityQueueIF
public void add(PriorityQueueObject elem)
add
in interface PriorityQueueIF
elem
- the object to addpublic PriorityQueueObject removeNext()
removeNext
in interface PriorityQueueIF
public void update(PriorityQueueObject elem)
update
in interface PriorityQueueIF
elem
- The object to update in the queuepublic PriorityQueueObject getElem(java.lang.String id)
id
-
public int size()
size
in interface PriorityQueueIF
protected void remove(PriorityQueueObject elem)
protected void siftup(int p, int q)
public void display()
public long getKeyComps()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |