|
Search this API | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.util.pq.BHeapIntNodePQ
public class BHeapIntNodePQ
This class implements a priority queue for nodes whose priority values are of type int.
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 IntNodePQv - a node in the priority 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 IntNodePQpublic Node getMin()
getMin in interface IntNodePQpublic int getMinPriority()
public boolean contains(Node v)
contains in interface IntNodePQpublic boolean isEmpty()
isEmpty in interface IntNodePQpublic int size()
public int getPriority(Node v)
getPriority in interface IntNodePQpublic void remove(Node v)
public void clear()
clear in interface IntNodePQpublic void dispose()
dispose in interface IntNodePQ
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||