|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.util.pq.TreeIntNodePQ
Implements a priority queue for nodes based on AVL Trees. The priority values may be non-negative.
Constructor Summary | |
TreeIntNodePQ(Graph _graph)
Returns an empty Priority-Queue. |
|
TreeIntNodePQ(Graph _graph,
DataProvider _initValues)
Returns a new Priority-Queue initialized with all nodes of the graph. |
|
TreeIntNodePQ(NodeMap _valueMap)
Returns an empty Priority-Queue. |
Method Summary | |
void |
add(Node n,
int value)
Insertes a node into the queue. |
void |
clear()
Removes all entires from the queue. |
boolean |
contains(Node n)
Returns whether or not the given node is contained within this queue. |
void |
decreasePriority(Node n,
int value)
Decreases the value of a node in the queue to a certain value. |
void |
dispose()
Disposes this queue. |
Node |
getMin()
Returns the node with the minimal value in the queue. |
int |
getPriority(Node v)
Returns the current priority of the given node. |
boolean |
isEmpty()
Time complexity O(1). |
void |
remove(Node n)
Removes a node from the queue. |
Node |
removeMin()
Removes the node with the minimal value from the queue. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public TreeIntNodePQ(Graph _graph)
_graph
- the graph which contains the nodespublic TreeIntNodePQ(Graph _graph, DataProvider _initValues)
_graph
- the graph which contains the nodes_initValues
- the initial priority-values of the nodes.public TreeIntNodePQ(NodeMap _valueMap)
NodeMap
as argument
which is used to store the priority values.
_valueMap
- here the priority values are storedMethod Detail |
public boolean isEmpty()
isEmpty
in interface IntNodePQ
public boolean contains(Node n)
contains
in interface IntNodePQ
public void add(Node n, int value)
add
in interface IntNodePQ
public void remove(Node n)
public Node getMin()
getMin
in interface IntNodePQ
public Node removeMin()
removeMin
in interface IntNodePQ
public void decreasePriority(Node n, int value)
decreasePriority
in interface IntNodePQ
n
- a node in the priotity queue.value
- the new priority value of the node.public void clear()
clear
in interface IntNodePQ
public int getPriority(Node v)
IntNodePQ
getPriority
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 |