Packagecom.yworks.yfiles.util.pq
Classpublic class IntObjectPQ
InheritanceIntObjectPQ Inheritance YObject Inheritance Object

This class implements a priority queue for objects whose priority values are of type int.

The implementation is based on binary heaps.



Public Properties
 PropertyDefined By
  empty : Boolean
[read-only] Returns whether or not this queue is empty Complexity O(1)
IntObjectPQ
  min : Object
[read-only] Returns he node with smallest priority in this queue.
IntObjectPQ
  minPriority : int
[read-only] Returns the minimum priority value in this queue.
IntObjectPQ
Public Methods
 MethodDefined By
  
IntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor, init:Boolean = true)
Creates an empty ObjectPQ using the given com.yworks.yfiles.base.DataProvider and com.yworks.yfiles.base.DataAcceptor to store and retrieve Object support information.
IntObjectPQ
  
add(o:Object, priority:int):void
Adds the given node with with given priority to this queue.
IntObjectPQ
  
changePriority(o:Object, p:int):void
Changes the priority value of the given node.
IntObjectPQ
  
clear():void
Makes this queue the empty queue.
IntObjectPQ
  
contains(o:Object):Boolean
Returns whether or not the given node is contained in this queue.
IntObjectPQ
  
decreasePriority(o:Object, priority:int):void
Decreases the priority value of the given node.
IntObjectPQ
  
dispose():void
Does nothing.
IntObjectPQ
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
IntObjectPQ
  
getPriority(o:Object):int
Returns the current priority of the given node.
IntObjectPQ
 Inherited
hashCode():int
YObject
  
increasePriority(o:Object, priority:int):void
Increases the priority value of the given node.
IntObjectPQ
  
newIntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor):IntObjectPQ
[static] Creates an empty ObjectPQ using the given com.yworks.yfiles.base.DataProvider and com.yworks.yfiles.base.DataAcceptor to store and retrieve Object support information.
IntObjectPQ
  
remove(o:Object):void
Removes the given node from this queue.
IntObjectPQ
  
removeMin():Object
Removes the node with smallest priority from this queue Precondition !isEmpty() Complexity O(log(size()))
IntObjectPQ
  
size():int
Returns the number of nodes currently in this queue Complexity O(1)
IntObjectPQ
Protected Methods
 MethodDefined By
  
initIntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor):void
Initializes this object.
IntObjectPQ
Property Detail
emptyproperty
empty:Boolean  [read-only]

Returns whether or not this queue is empty

Complexity O(1)


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

Returns he node with smallest priority in this queue.

Precondition !isEmpty()


Implementation
    public function get min():Object
minPriorityproperty 
minPriority:int  [read-only]

Returns the minimum priority value in this queue.


Implementation
    public function get minPriority():int
Constructor Detail
IntObjectPQ()Constructor
public function IntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor, init:Boolean = true)

Creates an empty ObjectPQ using the given com.yworks.yfiles.base.DataProvider and com.yworks.yfiles.base.DataAcceptor to store and retrieve Object support information. The contents of the provider should be modified through the use of the acceptor, i.e. they should be based on the same initially empty backing store. Additionally this backing store should not be modified externally as long as this PQ is still in use.

Parameters
initialSize:int
 
provider:DataProvider
 
acceptor:DataAcceptor
 
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.

See also

Method Detail
add()method
public function add(o:Object, priority:int):void

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

Precondition !contains(v)

Complexity O(log(size()))

Parameters

o:Object
 
priority:int

changePriority()method 
public function changePriority(o:Object, p:int):void

Changes the priority value of the given node.

Precondition contains(v)

Complexity O(log(size()))

Parameters

o:Object
 
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(o:Object):Boolean

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

Complexity O(1)

Parameters

o:Object

Returns
Boolean
decreasePriority()method 
public function decreasePriority(o:Object, priority:int):void

Decreases the priority value of the given node.

Precondition contains(v)

Precondition priority < getPriority(v)

Complexity O(log(size()))

Parameters

o:Object
 
priority:int

dispose()method 
public function dispose():void

Does nothing.

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

Returns
Class
getPriority()method 
public function getPriority(o:Object):int

Returns the current priority of the given node.

Precondition contains(v)

Parameters

o:Object

Returns
int
increasePriority()method 
public function increasePriority(o:Object, priority:int):void

Increases the priority value of the given node.

Precondition contains(v)

Precondition priority > getPriority(v)

Complexity O(log(size()))

Parameters

o:Object
 
priority:int

initIntObjectPQ()method 
protected final function initIntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor):void

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

Parameters

initialSize:int
 
provider:DataProvider
 
acceptor:DataAcceptor

See also

newIntObjectPQ()method 
public static function newIntObjectPQ(initialSize:int, provider:DataProvider, acceptor:DataAcceptor):IntObjectPQ

Creates an empty ObjectPQ using the given com.yworks.yfiles.base.DataProvider and com.yworks.yfiles.base.DataAcceptor to store and retrieve Object support information. The contents of the provider should be modified through the use of the acceptor, i.e. they should be based on the same initially empty backing store. Additionally this backing store should not be modified externally as long as this PQ is still in use.

Parameters

initialSize:int
 
provider:DataProvider
 
acceptor:DataAcceptor

Returns
IntObjectPQ

See also

remove()method 
public function remove(o:Object):void

Removes the given node from this queue.

Precondition contains(v)

Complexity O(log(size()))

Parameters

o:Object

removeMin()method 
public function removeMin():Object

Removes the node with smallest priority from this queue

Precondition !isEmpty()

Complexity O(log(size()))

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

Returns the number of nodes currently in this queue

Complexity O(1)

Returns
int