| Package | com.asterisq.graph |
| Class | public class LinkedNode |
| Inheritance | LinkedNode Node GraphItem flash.events.EventDispatcher |
| Property | Defined by | ||
|---|---|---|---|
![]() | data : Object | GraphItem | |
| degree : uint [read-only]
The number of edges connected to this node.
| LinkedNode | ||
| directPredecessorNodeIDs : Array [read-only]
A list of IDs of connected nodes with this node at the edge's head.
| LinkedNode | ||
| directPredecessorNodes : Array [read-only]
A list of connected nodes with this node at the edge's head.
| LinkedNode | ||
| directSuccessorNodeIDs : Array [read-only]
A list of IDs of connected nodes with this node at the edge's tail.
| LinkedNode | ||
| directSuccessorNodes : Array [read-only]
A list of connected nodes with this node at the edge's tail.
| LinkedNode | ||
| edges : Array [read-only]
Fetches a list of this node's edges.
| LinkedNode | ||
![]() | id : String | GraphItem | |
| inDegree : uint [read-only]
The number of edges directed at this node.
| LinkedNode | ||
| isLeaf : Boolean [read-only]
Determines whether this node is a leaf node.
| LinkedNode | ||
| neighborNodeIDs : Array [read-only]
The IDs of any nodes that are connected to this node by an edge.
| LinkedNode | ||
| neighborNodes : Array [read-only]
Any nodes that are connected to this node by an edge.
| LinkedNode | ||
| numEdges : uint [read-only]
The number of edges related to this node.
| LinkedNode | ||
| outDegree : uint [read-only]
The number of edges directed away from this node.
| LinkedNode | ||
| Method | Defined by | ||
|---|---|---|---|
|
LinkedNode(id:String = null, data:Object = null)
Creates a new linked node.
| LinkedNode | ||
![]() |
getDataProperty(propertyName:String):*
Fetches the value of a particular property of this graph item's data.
| GraphItem | |
|
getEdgesByDataProperty(propertyName:String, value:*):Array
Fetches a list of this node's edges that match the given property name and
value.
| LinkedNode | ||
|
getPathToNode(targetNode:LinkedNode, maxDistance:int = -1, result:IGraph = null, distanceParamName:String = null):IGraph
Finds the shortest path to the given node.
| LinkedNode | ||
|
getShortestPathsToNode(targetNode:LinkedNode, maxDistance:int = -1, resultClass:Class = null, distanceParamName:String = null):Array
Finds all the shortest paths to the given node.
| LinkedNode | ||
|
getSubTree(treeDepth:int, result:IGraph = null, readDepthParamName:String = null, writeDepthParamName:String = null):IGraph
Fetches a graph containing child nodes and edges up to the given depth.
| LinkedNode | ||
|
Fetches a graph containing connected nodes and edges up to the given depth.
| LinkedNode | ||
|
hasNeighbor(nodeID:String):Boolean
Determines whether the node with the given ID is connected to this node.
| LinkedNode | ||
|
hasSameNeighbors(node:LinkedNode):Boolean
Determines whether the given node has the same neighbor nodes as this node.
| LinkedNode | ||
![]() |
setDataProperty(propertyName:String, value:*):void
Sets the value of a particular property of this graph item's data.
| GraphItem | |
|
toString():String
| LinkedNode | ||
| degree | property |
degree:uint [read-only]
The number of edges connected to this node. Synonymous with the
numEdges property.
public function get degree():uint
See also
| directPredecessorNodeIDs | property |
directPredecessorNodeIDs:Array [read-only]A list of IDs of connected nodes with this node at the edge's head.
Implementation public function get directPredecessorNodeIDs():Array
| directPredecessorNodes | property |
directPredecessorNodes:Array [read-only]A list of connected nodes with this node at the edge's head.
Implementation public function get directPredecessorNodes():Array
| directSuccessorNodeIDs | property |
directSuccessorNodeIDs:Array [read-only]A list of IDs of connected nodes with this node at the edge's tail.
Implementation public function get directSuccessorNodeIDs():Array
| directSuccessorNodes | property |
directSuccessorNodes:Array [read-only]A list of connected nodes with this node at the edge's tail.
Implementation public function get directSuccessorNodes():Array
| edges | property |
edges:Array [read-only]Fetches a list of this node's edges.
Implementation public function get edges():Array
| inDegree | property |
inDegree:uint [read-only]The number of edges directed at this node.
Implementation public function get inDegree():uint
| isLeaf | property |
isLeaf:Boolean [read-only]Determines whether this node is a leaf node.
Implementation public function get isLeaf():Boolean
| neighborNodeIDs | property |
neighborNodeIDs:Array [read-only]The IDs of any nodes that are connected to this node by an edge.
Implementation public function get neighborNodeIDs():Array
| neighborNodes | property |
neighborNodes:Array [read-only]Any nodes that are connected to this node by an edge.
Implementation public function get neighborNodes():Array
| numEdges | property |
numEdges:uint [read-only]
The number of edges related to this node. Synonymous with the
degree property.
public function get numEdges():uint
See also
| outDegree | property |
outDegree:uint [read-only]The number of edges directed away from this node.
Implementation public function get outDegree():uint
| LinkedNode | () | constructor |
public function LinkedNode(id:String = null, data:Object = null)Creates a new linked node.
Parametersid:String (default = null) |
|
data:Object (default = null) |
| getEdgesByDataProperty | () | method |
public function getEdgesByDataProperty(propertyName:String, value:*):ArrayFetches a list of this node's edges that match the given property name and value.
ParameterspropertyName:String |
|
value:* |
Array |
| getPathToNode | () | method |
public function getPathToNode(targetNode:LinkedNode, maxDistance:int = -1, result:IGraph = null, distanceParamName:String = null):IGraphFinds the shortest path to the given node.
ParameterstargetNode:LinkedNode — The node at the other end of the path.
|
|
maxDistance:int (default = -1) — The maximum distance to search for a path. A value of -1
indicates no maximum.
|
|
result:IGraph (default = null) — Stores the resulting tree. If null, a new Graph instance is used.
|
|
distanceParamName:String (default = null) — The name of a parameter to store each node's distance from this node.
|
IGraph —
A graph containing the nodes and edges in the path or null if no path was found.
|
| getShortestPathsToNode | () | method |
public function getShortestPathsToNode(targetNode:LinkedNode, maxDistance:int = -1, resultClass:Class = null, distanceParamName:String = null):ArrayFinds all the shortest paths to the given node.
ParameterstargetNode:LinkedNode — The node at the other end of the path.
|
|
maxDistance:int (default = -1) — The maximum distance to search for a path. A value of -1
indicates no maximum.
|
|
resultClass:Class (default = null) — The class that will store path results. This class must implement IGraph. Default is Graph.
|
|
distanceParamName:String (default = null) — The name of a parameter to store each node's distance from this node.
|
Array — An array of graphs containing the nodes and edges in each path found.
|
| getSubTree | () | method |
public function getSubTree(treeDepth:int, result:IGraph = null, readDepthParamName:String = null, writeDepthParamName:String = null):IGraphFetches a graph containing child nodes and edges up to the given depth. If the depth argument is set to -1, the depth is unlimited.
If readDepthParamName is null, this method uses the edge directionality
to determine ancestry. An edge's tail node is the parent and the head node is the child.
The resulting graph will only contain ancestors of this node according to the edge
directionality.
If readDepthParamName is not null, this method uses a node data property
indicating depth to determine the the ancestry in a graph. The tree is only traversed
in the direction of higher depth values. So if this node has a depth parameter value of
4, the nodes with depth values 0, 1, 2, 3 are not added to the resulting graph.
Unlike the getTree method, the depth properties are not modified.
treeDepth:int — The maximum depth of the tree.
|
|
result:IGraph (default = null) — Stores the resulting tree. If null, a new Graph is returned.
|
|
readDepthParamName:String (default = null) — The name of a parameter which stores the depth of the node in the original tree. If
the tree's ancestry is indicated by edge directionality use a value of null.
|
|
writeDepthParamName:String (default = null) — The name of a parameter to store the node's depth in the resulting tree.
|
IGraph |
| getTree | () | method |
public function getTree(treeDepth:int, result:IGraph = null, depthParamName:String = null):IGraphFetches a graph containing connected nodes and edges up to the given depth. If the depth argument is set to -1, the depth is unlimited.
This method can also, optionally, set a parameter on each node to indicate the depth of that node in the resulting tree. For example, if the value of depthParamName is set to "node_depth" then the root node will have a node_depth of zero, its neighbors a depth of one, their neighbors two, and so on. These values can be retrieved like this:
var nodeDepth:int = node.getDataProperty('node_depth');
treeDepth:int — The maximum depth of the tree.
|
|
result:IGraph (default = null) — Stores the resulting tree. If null, a new Graph is returned.
|
|
depthParamName:String (default = null) — The name of a parameter to store the node's depth in the resulting tree.
|
IGraph |
| hasNeighbor | () | method |
public function hasNeighbor(nodeID:String):BooleanDetermines whether the node with the given ID is connected to this node.
ParametersnodeID:String |
Boolean |
| hasSameNeighbors | () | method |
public function hasSameNeighbors(node:LinkedNode):BooleanDetermines whether the given node has the same neighbor nodes as this node.
Parametersnode:LinkedNode |
Boolean |
| toString | () | method |
public override function toString():StringReturns
String |