Packagecom.yworks.yfiles.util.pq
Classpublic class TreeIntNodePQ
InheritanceTreeIntNodePQ Inheritance YObject Inheritance Object
Implements IntNodePQ

Implements a priority queue for nodes based on AVL Trees. The priority values may be non-negative.



Public Properties
 PropertyDefined By
  empty : Boolean
[read-only] Complexity O(1).
TreeIntNodePQ
  min : Node
[read-only] Returns the node with the minimal value in the queue. Complexity O(log(n)).
TreeIntNodePQ
Public Methods
 MethodDefined By
  
TreeIntNodePQ(_graph:Graph, init:Boolean = true)
Returns an empty Priority-Queue.
TreeIntNodePQ
  
add(n:Node, value:int):void
Inserts a node into the queue.
TreeIntNodePQ
  
clear():void
Removes all entities from the queue. Complexity O(1).
TreeIntNodePQ
  
contains(n:Node):Boolean
Returns whether or not the given node is contained within this queue. Complexity O(log(n)).
TreeIntNodePQ
  
decreasePriority(n:Node, value:int):void
Decreases the value of a node in the queue to a certain value. Complexity O(log(n)).
TreeIntNodePQ
  
dispose():void
Disposes this queue.
TreeIntNodePQ
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
TreeIntNodePQ
  
TreeIntNodePQ
 Inherited
hashCode():int
YObject
  
[static] Returns an empty Priority-Queue.
TreeIntNodePQ
  
[static] Returns an empty Priority-Queue.
TreeIntNodePQ
  
[static] Returns a new Priority-Queue initialized with all nodes of the graph.
TreeIntNodePQ
  
remove(n:Node):void
Removes a node from the queue.
TreeIntNodePQ
  
Removes the node with the minimal value from the queue. Complexity O(log(n)).
TreeIntNodePQ
Protected Methods
 MethodDefined By
  
Initializes this object.
TreeIntNodePQ
  
initTreeIntNodePQ2(_valueMap:NodeMap):void
Initializes this object.
TreeIntNodePQ
  
initTreeIntNodePQ3(_graph:Graph, _initValues:DataProvider):void
Initializes this object.
TreeIntNodePQ
Property Detail
emptyproperty
empty:Boolean  [read-only]

Complexity O(1).


Implementation
    public function get empty():Boolean
minproperty 
min:Node  [read-only]

Returns the node with the minimal value in the queue.

Complexity O(log(n)).


Implementation
    public function get min():Node
Constructor Detail
TreeIntNodePQ()Constructor
public function TreeIntNodePQ(_graph:Graph, init:Boolean = true)

Returns an empty Priority-Queue.

Parameters
_graph:Graph — the graph which contains the nodes
 
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.
Method Detail
add()method
public function add(n:Node, value:int):void

Inserts a node into the queue.

Complexity O(log(n)).

Parameters

n:Node
 
value:int

clear()method 
public function clear():void

Removes all entities from the queue.

Complexity O(1).

contains()method 
public function contains(n:Node):Boolean

Returns whether or not the given node is contained within this queue.

Complexity O(log(n)).

Parameters

n:Node

Returns
Boolean
decreasePriority()method 
public function decreasePriority(n:Node, value:int):void

Decreases the value of a node in the queue to a certain value.

Complexity O(log(n)).

Parameters

n:Node — a node in the priority queue.
 
value:int — the new priority value of the node.

dispose()method 
public function dispose():void

Disposes this queue. It is important to call this method after the queue is not needed anymore, to free hold resources.

getClass()method 
override public function getClass():Class

Returns
Class
getPriority()method 
public function getPriority(v:Node):int

Parameters

v:Node

Returns
int
initTreeIntNodePQ1()method 
protected final function initTreeIntNodePQ1(_graph:Graph):void

Initializes this object. See the documentation of the corresponding factory method newTreeIntNodePQ1() for details.

Parameters

_graph:Graph

See also

initTreeIntNodePQ2()method 
protected final function initTreeIntNodePQ2(_valueMap:NodeMap):void

Initializes this object. See the documentation of the corresponding factory method newTreeIntNodePQ2() for details.

Parameters

_valueMap:NodeMap

See also

initTreeIntNodePQ3()method 
protected final function initTreeIntNodePQ3(_graph:Graph, _initValues:DataProvider):void

Initializes this object. See the documentation of the corresponding factory method newTreeIntNodePQ3() for details.

Parameters

_graph:Graph
 
_initValues:DataProvider

See also

newTreeIntNodePQ1()method 
public static function newTreeIntNodePQ1(_graph:Graph):TreeIntNodePQ

Returns an empty Priority-Queue.

Parameters

_graph:Graph — the graph which contains the nodes

Returns
TreeIntNodePQ
newTreeIntNodePQ2()method 
public static function newTreeIntNodePQ2(_valueMap:NodeMap):TreeIntNodePQ

Returns an empty Priority-Queue. This constructor takes a NodeMap as argument which is used to store the priority values.

Parameters

_valueMap:NodeMap — here the priority values are stored

Returns
TreeIntNodePQ
newTreeIntNodePQ3()method 
public static function newTreeIntNodePQ3(_graph:Graph, _initValues:DataProvider):TreeIntNodePQ

Returns a new Priority-Queue initialized with all nodes of the graph.

Parameters

_graph:Graph — the graph which contains the nodes
 
_initValues:DataProvider — the initial priority-values of the nodes.

Returns
TreeIntNodePQ
remove()method 
public function remove(n:Node):void

Removes a node from the queue.

Complexity O(log(n)).

Parameters

n:Node

removeMin()method 
public function removeMin():Node

Removes the node with the minimal value from the queue.

Complexity O(log(n)).

Returns
Node