Path Class
Models the path between two Nodes/Ports, which consists of a series of [Node/Port, Edge] pairs.
Item Index
Methods
Properties
Methods
contains

Node/Port/Edge,

[doNotFuzzyMatchNodes=false]
Returns whether or not a Path contains the given object.
Parameters:
Returns:
True if Path contains the object, false otherwise.
deleteAll
()
Deletes every object in this Path from the underlying Toolkit toolkit.
deleteEdges
()
Deletes every Edge in this Path from the underlying Toolkit toolkit.
deleteNodes
()
Deletes every Node in this Path from the underlying Toolkit toolkit. Note that this has the effect of also deleting all the Edges, so this is analogous to #deleteAll.
each

fn
Iterates through the path one step at a time. Each step consists of an object containing a
vertex
, and, for all entries except the first, an edge
member, which supplies the Edge that links
to the Vertex (which is why it is null for the first entry).
Parameters:

fn
FunctionFunction to call for each step. Arguments are
(index, {vertex:v,edge:e})
.
eachEdge

fn
Iterates through the Edges in the path one step at a time. There is always one fewer Edges than Nodes/Ports.
Parameters:

fn
FunctionFunction to call for each step. Arguments are
(index, Edge)
.
eachNode

fn
Iterates through the Nodes/Ports in the path one step at a time.
Parameters:

fn
FunctionFunction to call for each step. Arguments are
(index, NodePort)
.
exists
()
Boolean
Returns whether or not a given path exists.
Returns:
True if path exists, false otherwise.
getCost
()
Number
Returns the cost of a given path, computed as the sum of the cost of all of the edges in the path.
Returns:
Total cost of the Path. Null if path does not exist.
getEdgeCount
()
Integer
Gets the number of Edges in the Path.
Returns:
Number of Edges in the Path.
getNodeAt

idx
Gets the Node at the given index in the path.
Parameters:

idx
Object
Returns:
getNodeCount
()
Integer
Gets the number of Nodes in the Path.
Returns:
Number of Nodes in the Path.
isEmpty
()
Boolean
Returns whether or not a given path is empty
Returns:
True if path is empty, false otherwise.
selectAllEdges

params
Select all edges in the toolkit toolkit.
Parameters:

params
ObjectParameters for the selectAllEdges call.
Properties
path
Graph.Path
The Path from the underlying Graph. See Graph documentation.