Package | com.yworks.yfiles.util.pq |
Class | public class BHeapIntNodePQ |
Inheritance | BHeapIntNodePQ YObject Object |
Implements | IntNodePQ |
The implementation is based on binary heaps.
Property | Defined By | ||
---|---|---|---|
empty : Boolean [read-only]
Returns whether or not this queue is empty
Complexity O(1)
| BHeapIntNodePQ | ||
min : Node [read-only]
Returns he node with smallest priority in this queue. | BHeapIntNodePQ | ||
minPriority : int [read-only]
Returns the minimum priority value in this queue. | BHeapIntNodePQ |
Method | Defined By | ||
---|---|---|---|
BHeapIntNodePQ(graph:Graph, init:Boolean = true)
Creates an empty NodePQ for nodes contained in the given graph. | BHeapIntNodePQ | ||
Adds the given node with with given priority to this queue. | BHeapIntNodePQ | ||
changePriority(v:Node, p:int):void
Changes the priority value of the given node. | BHeapIntNodePQ | ||
clear():void
Makes this queue the empty queue. | BHeapIntNodePQ | ||
Returns whether or not the given node is contained in this queue. | BHeapIntNodePQ | ||
decreasePriority(v:Node, priority:int):void
Decreases the priority value of the given node. | BHeapIntNodePQ | ||
dispose():void
Does nothing. | BHeapIntNodePQ | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | BHeapIntNodePQ | ||
getPriority(v:Node):int
Returns the current priority of the given node. | BHeapIntNodePQ | ||
hashCode():int | YObject | ||
increasePriority(v:Node, priority:int):void
Increases the priority value of the given node. | BHeapIntNodePQ | ||
[static]
Creates an empty NodePQ for nodes contained in the given graph. | BHeapIntNodePQ | ||
Removes the given node from this queue. | BHeapIntNodePQ | ||
Removes the node with smallest priority from this queue
Precondition !isEmpty()
Complexity O(log(size()))
| BHeapIntNodePQ | ||
size():int
Returns the number of nodes currently in this queue
Complexity O(1)
| BHeapIntNodePQ |
Method | Defined By | ||
---|---|---|---|
initBHeapIntNodePQ(graph:Graph):void
Initializes this object. | BHeapIntNodePQ |
empty | property |
empty:Boolean
[read-only] Returns whether or not this queue is empty
Complexity O(1)
public function get empty():Boolean
min | property |
min:Node
[read-only] Returns he node with smallest priority in this queue.
Precondition !isEmpty()
public function get min():Node
minPriority | property |
minPriority:int
[read-only] Returns the minimum priority value in this queue.
public function get minPriority():int
BHeapIntNodePQ | () | Constructor |
public function BHeapIntNodePQ(graph:Graph, init:Boolean = true)
Creates an empty NodePQ for nodes contained in the given graph. Neither the node set nor the indices of the nodes of the given graph may change while this queue is being used.
Parametersgraph:Graph | |
init:Boolean (default = true ) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods.
This parameter can safely be ignored/omitted when calling the constructor.
|
add | () | method |
public function add(v:Node, priority:int):void
Adds the given node with with given priority to this queue.
Precondition !contains(v)
Complexity O(log(size()))
Parameters
v:Node | |
priority:int |
changePriority | () | method |
public function changePriority(v:Node, p:int):void
Changes the priority value of the given node.
Precondition contains(v)
Complexity O(log(size()))
Parameters
v:Node | |
p:int |
clear | () | method |
public function clear():void
Makes this queue the empty queue. in this queue.
Complexity O(graph.N())
contains | () | method |
public function contains(v:Node):Boolean
Returns whether or not the given node is contained in this queue.
Complexity O(1)
Parameters
v:Node |
Boolean |
decreasePriority | () | method |
public function decreasePriority(v:Node, priority:int):void
Decreases the priority value of the given node.
Precondition contains(v)
Precondition priority < getPriority(v)
Complexity O(log(size()))
Parameters
v:Node | |
priority:int |
dispose | () | method |
public function dispose():void
Does nothing.
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getPriority | () | method |
public function getPriority(v:Node):int
Returns the current priority of the given node.
Precondition contains(v)
Parameters
v:Node |
int |
increasePriority | () | method |
public function increasePriority(v:Node, priority:int):void
Increases the priority value of the given node.
Precondition contains(v)
Precondition priority > getPriority(v)
Complexity O(log(size()))
Parameters
v:Node | |
priority:int |
initBHeapIntNodePQ | () | method |
protected final function initBHeapIntNodePQ(graph:Graph):void
Initializes this object. See the documentation of the corresponding factory method newBHeapIntNodePQ()
for details.
Parameters
graph:Graph |
See also
newBHeapIntNodePQ | () | method |
public static function newBHeapIntNodePQ(graph:Graph):BHeapIntNodePQ
Creates an empty NodePQ for nodes contained in the given graph. Neither the node set nor the indices of the nodes of the given graph may change while this queue is being used.
Parameters
graph:Graph |
BHeapIntNodePQ |
remove | () | method |
public function remove(v:Node):void
Removes the given node from this queue.
Precondition contains(v)
Complexity O(log(size()))
Parameters
v:Node |
removeMin | () | method |
public function removeMin():Node
Removes the node with smallest priority from this queue
Precondition !isEmpty()
Complexity O(log(size()))
ReturnsNode — the removed node with smallest priority
|
size | () | method |
public function size():int
Returns the number of nodes currently in this queue
Complexity O(1)
Returnsint |