|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.pq.BHeapIntNodePQ
This class implements a priority queue for nodes whose priority values are of type double.
The implementation is based on binary heaps.
Constructor Summary | |
BHeapIntNodePQ(Graph graph)
Creates an empty NodePQ for nodes contained in the given graph. |
Method Summary | |
void |
add(Node v,
int priority)
Adds the given node with with given priority to this queue. |
void |
changePriority(Node v,
int 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,
int priority)
Decreases the priority value of the given node. |
void |
dispose()
Does nothing. |
Node |
getMin()
Returns he node with smallest priority in this queue. |
int |
getMinPriority()
Returns the minimum priority value in this queue. |
int |
getPriority(Node v)
Returns the current priority of the given node. |
void |
increasePriority(Node v,
int priority)
Increases the priority value of the given node. |
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 BHeapIntNodePQ(Graph graph)
Method Detail |
public void add(Node v, int priority)
add
in interface IntNodePQ
public void decreasePriority(Node v, int priority)
decreasePriority
in interface IntNodePQ
v
- a node in the priotity queue.priority
- the new priority value of the node.public void increasePriority(Node v, int priority)
public void changePriority(Node v, int p)
public Node removeMin()
removeMin
in interface IntNodePQ
public Node getMin()
getMin
in interface IntNodePQ
public int getMinPriority()
public boolean contains(Node v)
contains
in interface IntNodePQ
public boolean isEmpty()
isEmpty
in interface IntNodePQ
public int size()
public int getPriority(Node v)
getPriority
in interface IntNodePQ
public void remove(Node v)
public void clear()
clear
in interface IntNodePQ
public void dispose()
dispose
in interface IntNodePQ
|
© 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 |