|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.pq.BHeapNodePQ
This class represents a priority queue for nodes where the priority values are of type Object The implementation is based on binary heaps.
In case the priority values are of type double then using BHeapDoubleNodePQ
is slighly more efficent than using this generic NodePQ.
Constructor Summary | |
BHeapNodePQ(Graph graph,
Comparator c)
Creates an empty NodePQ for nodes contained in the given graph. |
|
BHeapNodePQ(Graph graph,
Comparator c,
NodeMap dynamicMap)
Creates an empty NodePQ for nodes contained in the given graph. |
Method Summary | |
void |
add(Node v,
Object priority)
Adds the given node with with given priority to this queue. |
void |
changePriority(Node v,
Object priority)
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,
Object priority)
Decreases the priority value of the given node. |
Node |
getMin()
Returns he node with smallest priority in this queue. |
Object |
getMinPriority()
Returns the minimum priority value in this queue. |
Object |
getPriority(Node v)
Returns the current priority of the given node. |
void |
increasePriority(Node v,
Object 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 BHeapNodePQ(Graph graph, Comparator c)
public BHeapNodePQ(Graph graph, Comparator c, NodeMap dynamicMap)
Method Detail |
public void add(Node v, Object priority)
add
in interface NodePQ
public void decreasePriority(Node v, Object priority)
decreasePriority
in interface NodePQ
public void increasePriority(Node v, Object priority)
public void changePriority(Node v, Object priority)
public Node removeMin()
removeMin
in interface NodePQ
public Node getMin()
getMin
in interface NodePQ
public Object getMinPriority()
public void remove(Node v)
public void clear()
clear
in interface NodePQ
public boolean contains(Node v)
contains
in interface NodePQ
public boolean isEmpty()
isEmpty
in interface NodePQ
public int size()
size
in interface NodePQ
public Object getPriority(Node v)
getPriority
in interface NodePQ
|
© 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 |