Packagecom.asterisq.graph
Classpublic class LinkedNode
InheritanceLinkedNode Inheritance Node Inheritance GraphItem Inheritance flash.events.EventDispatcher

A node in a linked graph.



Public Properties
 PropertyDefined by
 Inheriteddata : 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
 Inheritedid : 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
Public Methods
 MethodDefined by
  
LinkedNode(id:String = null, data:Object = null)
Creates a new linked node.
LinkedNode
 Inherited
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
  
getTree(treeDepth:int, result:IGraph = null, depthParamName:String = null):IGraph
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
  
Determines whether the given node has the same neighbor nodes as this node.
LinkedNode
 Inherited
setDataProperty(propertyName:String, value:*):void
Sets the value of a particular property of this graph item's data.
GraphItem
  
toString():String
LinkedNode
Property detail
degreeproperty
degree:uint  [read-only]

The number of edges connected to this node. Synonymous with the numEdges property.

Implementation
    public function get degree():uint

See also

directPredecessorNodeIDsproperty 
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
directPredecessorNodesproperty 
directPredecessorNodes:Array  [read-only]

A list of connected nodes with this node at the edge's head.

Implementation
    public function get directPredecessorNodes():Array
directSuccessorNodeIDsproperty 
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
directSuccessorNodesproperty 
directSuccessorNodes:Array  [read-only]

A list of connected nodes with this node at the edge's tail.

Implementation
    public function get directSuccessorNodes():Array
edgesproperty 
edges:Array  [read-only]

Fetches a list of this node's edges.

Implementation
    public function get edges():Array
inDegreeproperty 
inDegree:uint  [read-only]

The number of edges directed at this node.

Implementation
    public function get inDegree():uint
isLeafproperty 
isLeaf:Boolean  [read-only]

Determines whether this node is a leaf node.

Implementation
    public function get isLeaf():Boolean
neighborNodeIDsproperty 
neighborNodeIDs:Array  [read-only]

The IDs of any nodes that are connected to this node by an edge.

Implementation
    public function get neighborNodeIDs():Array
neighborNodesproperty 
neighborNodes:Array  [read-only]

Any nodes that are connected to this node by an edge.

Implementation
    public function get neighborNodes():Array
numEdgesproperty 
numEdges:uint  [read-only]

The number of edges related to this node. Synonymous with the degree property.

Implementation
    public function get numEdges():uint

See also

outDegreeproperty 
outDegree:uint  [read-only]

The number of edges directed away from this node.

Implementation
    public function get outDegree():uint
Constructor detail
LinkedNode()constructor
public function LinkedNode(id:String = null, data:Object = null)

Creates a new linked node.

Parameters
id:String (default = null)
 
data:Object (default = null)
Method detail
getEdgesByDataProperty()method
public function getEdgesByDataProperty(propertyName:String, value:*):Array

Fetches a list of this node's edges that match the given property name and value.

Parameters
propertyName:String
 
value:*

Returns
Array
getPathToNode()method 
public function getPathToNode(targetNode:LinkedNode, maxDistance:int = -1, result:IGraph = null, distanceParamName:String = null):IGraph

Finds the shortest path to the given node.

Parameters
targetNode: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.

Returns
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):Array

Finds all the shortest paths to the given node.

Parameters
targetNode: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.

Returns
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):IGraph

Fetches 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.

Parameters
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.

Returns
IGraph
getTree()method 
public function getTree(treeDepth:int, result:IGraph = null, depthParamName:String = null):IGraph

Fetches 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');

Parameters
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.

Returns
IGraph
hasNeighbor()method 
public function hasNeighbor(nodeID:String):Boolean

Determines whether the node with the given ID is connected to this node.

Parameters
nodeID:String

Returns
Boolean
hasSameNeighbors()method 
public function hasSameNeighbors(node:LinkedNode):Boolean

Determines whether the given node has the same neighbor nodes as this node.

Parameters
node:LinkedNode

Returns
Boolean
toString()method 
public override function toString():String

Returns
String