Package | com.yworks.yfiles.util.pq |
Class | public class BHeapNodePQ |
Inheritance | BHeapNodePQ YObject Object |
Implements | NodePQ |
See also
Property | Defined By | ||
---|---|---|---|
empty : Boolean [read-only]
Returns whether or not this queue is empty
Complexity O(1)
| BHeapNodePQ | ||
min : Node [read-only]
Returns he node with smallest priority in this queue. | BHeapNodePQ | ||
minPriority : Object [read-only]
Returns the minimum priority value in this queue. | BHeapNodePQ |
Method | Defined By | ||
---|---|---|---|
Creates an empty NodePQ for nodes contained in the given graph. | BHeapNodePQ | ||
Adds the given node with with given priority to this queue. | BHeapNodePQ | ||
changePriority(v:Node, priority:Object):void
Changes the priority value of the given node. | BHeapNodePQ | ||
clear():void
Makes this queue the empty queue. | BHeapNodePQ | ||
Returns whether or not the given node is contained in this queue. | BHeapNodePQ | ||
decreasePriority(v:Node, priority:Object):void
Decreases the priority value of the given node. | BHeapNodePQ | ||
equals(o:Object):Boolean | YObject | ||
getClass():Class [override] | BHeapNodePQ | ||
getPriority(v:Node):Object
Returns the current priority of the given node. | BHeapNodePQ | ||
hashCode():int | YObject | ||
increasePriority(v:Node, priority:Object):void | BHeapNodePQ | ||
[static]
Creates an empty NodePQ for nodes contained in the given graph. | BHeapNodePQ | ||
[static]
Creates an empty NodePQ for nodes contained in the given graph. | BHeapNodePQ | ||
Removes the given node from this queue. | BHeapNodePQ | ||
Removes the node with smallest priority from this queue
Precondition !isEmpty()
Complexity O(log(size()))
| BHeapNodePQ | ||
size():int
Returns the number of nodes currently in this queue
Complexity O(1)
| BHeapNodePQ |
Method | Defined By | ||
---|---|---|---|
Initializes this object. | BHeapNodePQ | ||
Initializes this object. | BHeapNodePQ |
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:Object
[read-only] Returns the minimum priority value in this queue.
public function get minPriority():Object
BHeapNodePQ | () | Constructor |
public function BHeapNodePQ(graph:Graph, c:Comparator, init:Boolean = true)
Creates an empty NodePQ for nodes contained in the given graph. The given comparator must be able to compare all nodes residing in this queue by their priority. Neither the node set nor the indices of the nodes of the given graph may change while this queue is being used.
Parametersgraph:Graph | |
c:Comparator | |
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:Object):void
Adds the given node with with given priority to this queue.
Precondition !contains(v)
Complexity O(log(size()))
Parameters
v:Node | |
priority:Object |
changePriority | () | method |
public function changePriority(v:Node, priority:Object):void
Changes the priority value of the given node.
Precondition contains(v)
Complexity O(log(size()))
Parameters
v:Node | |
priority:Object |
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:Object):void
Decreases the priority value of the given node.
Precondition contains(v)
Precondition c.compare(priority,getPriority(v)) < 0, where c is the corresponding comparator for the priorities in this queue.
Complexity O(log(size()))
Parameters
v:Node | |
priority:Object |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
getPriority | () | method |
public function getPriority(v:Node):Object
Returns the current priority of the given node.
Precondition contains(v)
Parameters
v:Node |
Object |
increasePriority | () | method |
initBHeapNodePQ1 | () | method |
protected final function initBHeapNodePQ1(graph:Graph, c:Comparator):void
Initializes this object. See the documentation of the corresponding factory method newBHeapNodePQ1()
for details.
Parameters
graph:Graph | |
c:Comparator |
See also
initBHeapNodePQ2 | () | method |
protected final function initBHeapNodePQ2(graph:Graph, c:Comparator, dynamicMap:NodeMap):void
Initializes this object. See the documentation of the corresponding factory method newBHeapNodePQ2()
for details.
Parameters
graph:Graph | |
c:Comparator | |
dynamicMap:NodeMap |
See also
newBHeapNodePQ1 | () | method |
public static function newBHeapNodePQ1(graph:Graph, c:Comparator):BHeapNodePQ
Creates an empty NodePQ for nodes contained in the given graph. The given comparator must be able to compare all nodes residing in this queue by their priority. 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 | |
c:Comparator |
BHeapNodePQ |
newBHeapNodePQ2 | () | method |
public static function newBHeapNodePQ2(graph:Graph, c:Comparator, dynamicMap:NodeMap):BHeapNodePQ
Creates an empty NodePQ for nodes contained in the given graph. The given comparator must be able to compare all nodes residing in this queue by their priority. By providing a NodeMap that can handle dynamic changes of its definition range this queue will be enabled to function even when the node set of the given graph changes.
Parameters
graph:Graph | |
c:Comparator | |
dynamicMap:NodeMap |
BHeapNodePQ |
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 |