|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.pq.BHeapDoubleNodePQ
This class implements a priority queue for nodes whose priority values are of type double.
The implementation is based on binary heaps.
Constructor Summary | |
BHeapDoubleNodePQ(Graph graph)
Creates an empty NodePQ for nodes contained in the given graph. |
Method Summary | |
void |
add(Node v,
double value)
Adds the given node with with given priority to this queue. |
void |
changePriority(Node v,
double p)
Changes the priority value of the given node. |
void |
clear()
Makes this queue the empty queue. |
boolean |
contains(Node v)
Returns whether or not the given node is contained in this queue. |
void |
decreasePriority(Node v,
double priority)
Decreases the priority value of the given node. |
void |
dispose()
Does nothing. |
Node |
getMin()
Returns he node with smallest priority in this queue. |
double |
getMinPriority()
Returns the minimum priority value in this queue. |
double |
getPriority(Node v)
Returns the current priority of the given node. |
void |
increasePriority(Node v,
double priority)
|
boolean |
isEmpty()
Returns whether or not this queue is empty |
void |
remove(Node v)
Removes the given node from this queue. |
Node |
removeMin()
Removes the node with smallest priority from this queue |
int |
size()
Returns the number of nodes currently in this queue |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BHeapDoubleNodePQ(Graph graph)
Method Detail |
public void add(Node v, double value)
add
in interface DoubleNodePQ
public void decreasePriority(Node v, double priority)
decreasePriority
in interface DoubleNodePQ
v
- a node in the priotity queue.priority
- the new priority of the node.public void increasePriority(Node v, double priority)
public void changePriority(Node v, double p)
public Node removeMin()
removeMin
in interface DoubleNodePQ
public Node getMin()
getMin
in interface DoubleNodePQ
public double getMinPriority()
public boolean contains(Node v)
contains
in interface DoubleNodePQ
public boolean isEmpty()
isEmpty
in interface DoubleNodePQ
public int size()
public double getPriority(Node v)
getPriority
in interface DoubleNodePQ
public void remove(Node v)
public void clear()
clear
in interface DoubleNodePQ
public void dispose()
dispose
in interface DoubleNodePQ
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |