Packagecom.yworks.yfiles.layout.router.polyline
Classpublic class Path
InheritancePath Inheritance YObject Inheritance Object

A Path represents the result of a path search as a list of consecutive com.yworks.yfiles.layout.router.polyline.CellEntrance s. A Path starts with an entrance into a com.yworks.yfiles.layout.router.polyline.PartitionCell of the source node and ends with one into a com.yworks.yfiles.layout.router.polyline.PartitionCell of the target node.

See also

com.yworks.yfiles.layout.router.polyline.PathSearch
com.yworks.yfiles.layout.router.polyline.PathSearchResult
com.yworks.yfiles.layout.router.polyline.CellEntrance
com.yworks.yfiles.layout.router.polyline.PartitionCell


Public Properties
 PropertyDefined By
  cost : Number
[read-only] Returns the overall cost of this path.
Path
  edge : Edge
[read-only] Returns the edge this path was calculated for.
Path
Public Methods
 MethodDefined By
  
Path(edge:Edge, entrances:List, cost:Number, init:Boolean = true)
Creates a new instance.
Path
 Inherited
equals(o:Object):Boolean
YObject
  
getClass():Class
[override]
Path
  
Returns the com.yworks.yfiles.layout.router.polyline.CellEntrance at the given position of this path.
Path
 Inherited
hashCode():int
YObject
  
length():int
Returns the count of com.yworks.yfiles.layout.router.polyline.CellEntrance objects this path consists of.
Path
  
newPath(edge:Edge, entrances:List, cost:Number):Path
[static] Creates a new instance.
Path
  
positionOf(entrance:CellEntrance):int
Returns the position of the first occurrence of the given com.yworks.yfiles.layout.router.polyline.CellEntrance in this path, or -1 if this path does not contain the com.yworks.yfiles.layout.router.polyline.CellEntrance.
Path
  
setEntrance(position:int, entrance:CellEntrance):void
Replaces the com.yworks.yfiles.layout.router.polyline.CellEntrance at the given position of this path with the given com.yworks.yfiles.layout.router.polyline.CellEntrance.
Path
Protected Methods
 MethodDefined By
  
initPath(edge:Edge, entrances:List, cost:Number):void
Initializes this object.
Path
Property Detail
costproperty
cost:Number  [read-only]

Returns the overall cost of this path.


Implementation
    public function get cost():Number
edgeproperty 
edge:Edge  [read-only]

Returns the edge this path was calculated for.


Implementation
    public function get edge():Edge
Constructor Detail
Path()Constructor
public function Path(edge:Edge, entrances:List, cost:Number, init:Boolean = true)

Creates a new instance.

Parameters
edge:Edge — The edge the path was calculated for.
 
entrances:List — A list of com.yworks.yfiles.layout.router.polyline.CellEntrance objects describing the edge path from source node to target node.
 
cost:Number — The overall cost of this path.
 
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
getClass()method
override public function getClass():Class

Returns
Class
getEntrance()method 
public function getEntrance(position:int):CellEntrance

Returns the com.yworks.yfiles.layout.router.polyline.CellEntrance at the given position of this path.

Parameters

position:int — position of the com.yworks.yfiles.layout.router.polyline.CellEntrance to return

Returns
CellEntrance — the com.yworks.yfiles.layout.router.polyline.CellEntrance at the given position of this path

See also

initPath()method 
protected final function initPath(edge:Edge, entrances:List, cost:Number):void

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

Parameters

edge:Edge
 
entrances:List
 
cost:Number

See also

length()method 
public function length():int

Returns the count of com.yworks.yfiles.layout.router.polyline.CellEntrance objects this path consists of.

Returns
int — The count of com.yworks.yfiles.layout.router.polyline.CellEntrance objects this path consists of.

See also

newPath()method 
public static function newPath(edge:Edge, entrances:List, cost:Number):Path

Creates a new instance.

Parameters

edge:Edge — The edge the path was calculated for.
 
entrances:List — A list of com.yworks.yfiles.layout.router.polyline.CellEntrance objects describing the edge path from source node to target node.
 
cost:Number — The overall cost of this path.

Returns
Path

See also

positionOf()method 
public function positionOf(entrance:CellEntrance):int

Returns the position of the first occurrence of the given com.yworks.yfiles.layout.router.polyline.CellEntrance in this path, or -1 if this path does not contain the com.yworks.yfiles.layout.router.polyline.CellEntrance.

Parameters

entrance:CellEntrance — com.yworks.yfiles.layout.router.polyline.CellEntrance to search for

Returns
int — the position of the first occurrence of the given com.yworks.yfiles.layout.router.polyline.CellEntrance in this path, or -1 if this path does not contain the com.yworks.yfiles.layout.router.polyline.CellEntrance

See also

setEntrance()method 
public function setEntrance(position:int, entrance:CellEntrance):void

Replaces the com.yworks.yfiles.layout.router.polyline.CellEntrance at the given position of this path with the given com.yworks.yfiles.layout.router.polyline.CellEntrance.

Parameters

position:int — position of the com.yworks.yfiles.layout.router.polyline.CellEntrance to replace
 
entrance:CellEntrance — com.yworks.yfiles.layout.router.polyline.CellEntrance to be stored at the given position

See also