| Package | com.asterisq.graph |
| Class | public class LinkedGraph |
| Inheritance | LinkedGraph flash.events.EventDispatcher |
| Implements | IGraph |
| Property | Defined by | ||
|---|---|---|---|
| edgeLength : uint [read-only]
The number of edges in this graph.
| LinkedGraph | ||
| edges : Array [read-only]
A list of the edges in this graph.
| LinkedGraph | ||
| nodeLength : uint [read-only]
The number of nodes in this graph.
| LinkedGraph | ||
| nodes : Array [read-only]
A list of the nodes in this graph.
| LinkedGraph | ||
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new linked graph.
| LinkedGraph | ||
|
Adds a new edge to this graph.
| LinkedGraph | ||
|
Adds the nodes and edges in the given graph to this graph.
| LinkedGraph | ||
|
Adds a new node to this graph.
| LinkedGraph | ||
|
clear():void
Clears all nodes and edges in this graph.
| LinkedGraph | ||
|
Builds a graph containing only the edge which pass the given test function.
| LinkedGraph | ||
|
Builds a graph containing only the nodes which pass the given test function
and their edges.
| LinkedGraph | ||
|
getConnectedGraphs():Array
Fetches an array of connected graphs that are contained in this graph.
| LinkedGraph | ||
|
getEdgeByDataProperty(propertyName:String, value:*):IEdge
Fetches the first edge matching the given data property name and value.
| LinkedGraph | ||
|
getEdgeByHeadNodeID(nodeID:String):IEdge
Fetches an edge given the ID of its head node.
| LinkedGraph | ||
|
getEdgeByID(id:String):IEdge
Fetches an edge given its ID.
| LinkedGraph | ||
|
getEdgeByNodeID(nodeID:String):IEdge
Fetches an edge given the ID of one of its nodes.
| LinkedGraph | ||
|
getEdgeByNodeIDs(tailNodeID:String, headNodeID:String, bidirectional:Boolean = false):IEdge
Fetches an edge given the IDs of its nodes.
| LinkedGraph | ||
|
getEdgeByTailNodeID(nodeID:String):IEdge
Fetches an edge given the ID of its tail node.
| LinkedGraph | ||
|
getEdgesByDataProperty(propertyName:String, value:*):Array
Fetches a list of all edges matching the given data property name and value.
| LinkedGraph | ||
|
getNodeByDataProperty(propertyName:String, value:*):INode
Fetches the first node matching the given data property name and value.
| LinkedGraph | ||
|
getNodeByID(id:String):INode
Fetches a node given its ID.
| LinkedGraph | ||
|
getNodesByDataProperty(propertyName:String, value:*):Array
Fetches all nodes matching the given data property name and value.
| LinkedGraph | ||
|
getNodesWithSameNeighbors(node:LinkedNode):Array
Fetches the nodes that have the same neighbors as the given node.
| LinkedGraph | ||
|
hasEdge(id:String):Boolean
Determines whether the graph contains an edge with the given ID.
| LinkedGraph | ||
|
hasNode(id:String):Boolean
Determines whether a node with the given ID exists in this graph.
| LinkedGraph | ||
|
removeAllEdges():void
Removes all edges from this node graph.
| LinkedGraph | ||
|
removeAllNodes():void
Removes all nodes from this graph.
| LinkedGraph | ||
|
removeEdge(edge:IEdge):void
Removes the given edge from the node graph.
| LinkedGraph | ||
|
removeNode(node:INode):void
Removes the given node from this node graph.
| LinkedGraph | ||
|
removeNodeAndEdges(node:LinkedNode):void
Removes a node and all its edges.
| LinkedGraph | ||
|
Updates the contents of this graph to the given graph.
| LinkedGraph | ||
|
Converts this
LinkedGraph to a Graph
| LinkedGraph | ||
|
toString():String
| LinkedGraph | ||
| edgeLength | property |
edgeLength:uint [read-only]The number of edges in this graph.
Implementation public function get edgeLength():uint
| edges | property |
edges:Array [read-only]A list of the edges in this graph.
Implementation public function get edges():Array
| nodeLength | property |
nodeLength:uint [read-only]The number of nodes in this graph.
Implementation public function get nodeLength():uint
| nodes | property |
nodes:Array [read-only]A list of the nodes in this graph.
Implementation public function get nodes():Array
| LinkedGraph | () | constructor |
public function LinkedGraph()Creates a new linked graph.
| addEdge | () | method |
public function addEdge(id:String, tailNodeID:String, headNodeID:String, data:Object = null):IEdgeAdds a new edge to this graph.
Parametersid:String — A permanent, unique ID for the new edge.
|
|
tailNodeID:String — The ID of the tail node of the new edge.
|
|
headNodeID:String — The ID of the head node of the new edge.
|
|
data:Object (default = null) — Data to be associated with the new edge.
|
IEdge —
The new edge.
|
GraphError — Throws GraphError.DUPLICATE_EDGE if
the graph already contains an edge with the given ID.
|
|
GraphError — Throws GraphError.MISSING_TAIL_NODE
if the graph does not contain a node with the given tail node ID.
|
|
GraphError — Throws GraphError.MISSING_HEAD_NODE
if the graph does not contain a node with the given head node ID.
|
| addGraph | () | method |
public function addGraph(graph:IGraph):BooleanAdds the nodes and edges in the given graph to this graph. Nodes with duplicate IDs are ignored.
NOTE: Node and edge properties are not copied across.
Parametersgraph:IGraph |
Boolean — True if the graph changed false if the graphs were equivalent.
|
| addNode | () | method |
public function addNode(id:String, data:Object = null):INodeAdds a new node to this graph.
Parametersid:String — A permanent, unique ID for the new node.
|
|
data:Object (default = null) — Data to be associated with the new node.
|
INode —
The new node.
|
GraphError — Throws GraphError.DUPLICATE_NODE if
the graph already contains a node with the given ID.
|
| clear | () | method |
public function clear():voidClears all nodes and edges in this graph.
| filterByEdge | () | method |
public function filterByEdge(func:Function, result:IGraph = null):IGraphBuilds a graph containing only the edge which pass the given test function.
Parametersfunc:Function — The edge test function which takes an IEdge as a parameter and
returns true if the edge should be included in the resulting graph.
|
|
result:IGraph (default = null) — Stores the resulting graph. If null, a new Graph is returned.
|
IGraph —
A new graph containing edges that passed the filter function.
|
| filterByNode | () | method |
public function filterByNode(func:Function, result:IGraph = null):IGraphBuilds a graph containing only the nodes which pass the given test function and their edges.
Parametersfunc:Function — The node test function which takes an INode as a parameter and
returns true if the node should be included in the resulting graph.
|
|
result:IGraph (default = null) — Stores the resulting graph. If null, a new Graph is returned.
|
IGraph —
A new graph containing nodes that passed the filter function and
their edges.
|
| getConnectedGraphs | () | method |
public function getConnectedGraphs():ArrayFetches an array of connected graphs that are contained in this graph. If the graph is connected, one graph identical to this graph is returned.
ReturnsArray |
| getEdgeByDataProperty | () | method |
public function getEdgeByDataProperty(propertyName:String, value:*):IEdgeFetches the first edge matching the given data property name and value.
ParameterspropertyName:String |
|
value:* |
IEdge |
| getEdgeByHeadNodeID | () | method |
public function getEdgeByHeadNodeID(nodeID:String):IEdgeFetches an edge given the ID of its head node.
ParametersnodeID:String |
IEdge |
| getEdgeByID | () | method |
public function getEdgeByID(id:String):IEdgeFetches an edge given its ID.
Parametersid:String |
IEdge |
| getEdgeByNodeID | () | method |
public function getEdgeByNodeID(nodeID:String):IEdgeFetches an edge given the ID of one of its nodes.
ParametersnodeID:String |
IEdge |
| getEdgeByNodeIDs | () | method |
public function getEdgeByNodeIDs(tailNodeID:String, headNodeID:String, bidirectional:Boolean = false):IEdgeFetches an edge given the IDs of its nodes.
ParameterstailNodeID:String — The ID of the edge's tail node.
|
|
headNodeID:String — The ID of the edge's head node.
|
|
bidirectional:Boolean (default = false) — Indicates whether the tail node ID and head node ID can be swapped.
|
IEdge —
The edge with the given nodes or null if it doesn't exist.
|
| getEdgeByTailNodeID | () | method |
public function getEdgeByTailNodeID(nodeID:String):IEdgeFetches an edge given the ID of its tail node.
ParametersnodeID:String |
IEdge |
| getEdgesByDataProperty | () | method |
public function getEdgesByDataProperty(propertyName:String, value:*):ArrayFetches a list of all edges matching the given data property name and value.
ParameterspropertyName:String |
|
value:* |
Array |
| getNodeByDataProperty | () | method |
public function getNodeByDataProperty(propertyName:String, value:*):INodeFetches the first node matching the given data property name and value.
ParameterspropertyName:String |
|
value:* |
INode |
| getNodeByID | () | method |
public function getNodeByID(id:String):INodeFetches a node given its ID.
Parametersid:String |
INode |
| getNodesByDataProperty | () | method |
public function getNodesByDataProperty(propertyName:String, value:*):ArrayFetches all nodes matching the given data property name and value.
ParameterspropertyName:String |
|
value:* |
Array |
| getNodesWithSameNeighbors | () | method |
public function getNodesWithSameNeighbors(node:LinkedNode):ArrayFetches the nodes that have the same neighbors as the given node.
Parametersnode:LinkedNode |
Array |
| hasEdge | () | method |
public function hasEdge(id:String):BooleanDetermines whether the graph contains an edge with the given ID.
Parametersid:String |
Boolean |
| hasNode | () | method |
public function hasNode(id:String):BooleanDetermines whether a node with the given ID exists in this graph.
Parametersid:String |
Boolean |
| removeAllEdges | () | method |
public function removeAllEdges():voidRemoves all edges from this node graph.
| removeAllNodes | () | method |
public function removeAllNodes():voidRemoves all nodes from this graph.
GraphError — Throws GraphError.REFERENCED_NODE if
there are any edges.
|
| removeEdge | () | method |
public function removeEdge(edge:IEdge):voidRemoves the given edge from the node graph.
Parametersedge:IEdge |
| removeNode | () | method |
public function removeNode(node:INode):voidRemoves the given node from this node graph.
Parametersnode:INode |
GraphError — Throws GraphError.REFERENCED_NODE if
the given node is referenced by any edges.
|
| removeNodeAndEdges | () | method |
public function removeNodeAndEdges(node:LinkedNode):voidRemoves a node and all its edges.
Parametersnode:LinkedNode |
| setGraph | () | method |
public function setGraph(graph:IGraph):BooleanUpdates the contents of this graph to the given graph. If a node or edge is not contained in the given graph, it is removed. If a node or edge is present in the given graph but not in this graph, it is added.
NOTE: Properties of common nodes and edges will be overwritten.
Parametersgraph:IGraph |
Boolean — True if the graph was changed, false if the graphs were
equivalent.
|
| toGraph | () | method |
| toString | () | method |
public override function toString():StringReturns
String |