Packagecom.yworks.yfiles.util.pq
Interfacepublic interface NodePQ
Implementors BHeapNodePQ

Defines an interface for specialized priority queues that contains nodes which are prioritized by a comparable values.



Public Properties
 PropertyDefined By
  empty : Boolean
[read-only] Returns whether or not this queue is empty
NodePQ
  min : Node
[read-only] Returns he node with smallest priority in this queue.
NodePQ
Public Methods
 MethodDefined By
  
add(v:Node, priority:Object):void
Adds the given node with the given priority to the queue.
NodePQ
  
clear():void
Makes this queue the empty queue.
NodePQ
  
contains(v:Node):Boolean
Returns whether or not the given node is contained in this queue.
NodePQ
  
decreasePriority(v:Node, priority:Object):void
Decreased the priority value of the given node.
NodePQ
  
getPriority(v:Node):Object
Returns the current priority of the given node.
NodePQ
  
Removes the node with smallest priority from this queue.
NodePQ
  
size():int
Returns the number of nodes currently in this queue
NodePQ
Property Detail
emptyproperty
empty:Boolean  [read-only]

Returns whether or not this queue is empty


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

Returns he node with smallest priority in this queue.

Precondition !isEmpty()


Implementation
    public function get min():Node
Method Detail
add()method
public function add(v:Node, priority:Object):void

Adds the given node with the given priority to the queue.

Precondition !contains(v)

Parameters

v:Node
 
priority:Object

clear()method 
public function clear():void

Makes this queue the empty queue. in this queue.

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

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

Parameters

v:Node

Returns
Boolean
decreasePriority()method 
public function decreasePriority(v:Node, priority:Object):void

Decreased the priority value of the given node.

Precondition contains(v)

Precondition c.compare(p,getPriority(v)) < 0, where c is the corresponding comparator for the priorities in this queue.

Parameters

v:Node
 
priority:Object

getPriority()method 
public function getPriority(v:Node):Object

Returns the current priority of the given node.

Parameters

v:Node

Returns
Object
removeMin()method 
public function removeMin():Node

Removes the node with smallest priority from this queue.

Precondition !isEmpty()

Returns
Node — the removed node with smallest priority
size()method 
public function size():int

Returns the number of nodes currently in this queue

Returns
int