Cytoscape 2.8.0 API

giny.model
Interface RootGraph

All Known Subinterfaces:
CytoscapeRootGraph
All Known Implementing Classes:
CytoscapeFingRootGraph, FingExtensibleRootGraph

public interface RootGraph

GINY Architecture

A graph model consisting of nodes and the edges between them. GINY graph models are separated into RootGraphs and GraphPerspectives. RootGraphs contain all Nodes and Edges in a graph, while GraphPerspectives contain some subset of them (any given GraphPerspective may include all Nodes and Edges from its RootGraph, but it does not need to). Every GraphPerspective has exactly one RootGraph. RootGraphs may have any number of GraphPerspectives.

Indices

Every Node and Edge has a unique and unchanging index in its RootGraph; these indices are always negative integers and are not guaranteed to be consecutive. Note that if you would like to associate additional data with a Node or an Edge, you can associate the data with the Node's or the Edge's RootGraph index, which is guaranteed to be unique for the lifetime of the RootGraph.

MetaNodes

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren, and a Node or Edge may have any number of MetaParents. This is how GINY supports graphs-within-graphs.


Method Summary
 boolean addEdgeMetaChild(int parent_index, int child_edge_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean addMetaChild(Node parent, Edge child)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean addMetaChild(Node parent, Node child)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean addNodeMetaChild(int parent_index, int child_node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean containsEdge(Edge edge)
          Return true if the given Edge is in this RootGraph.
 boolean containsNode(Node node)
          Return true if the given Node is in this RootGraph.
 int createEdge(int source_index, int target_index)
          Create a directed Edge from the Node with the given source_index to the Node with the given target_index, and return the new Edge's index.
 int createEdge(int source_index, int target_index, boolean directed)
          Create an Edge from the Node with the given source_index to the Node with the given target_index, and return the new Edge's index.
 int createEdge(Node source, Node target)
          Create a directed Edge from the given source Node to the given target Node, and return its index.
 int createEdge(Node source, Node target, boolean directed)
          Create an Edge from the given source Node to the given target Node, and return its index.
 int[] createEdges(int[] source_indices, int[] target_indices, boolean directed)
          Deprecated. Use createEdge(int, int, boolean) instead.
 GraphPerspective createGraphPerspective(int[] node_indices, int[] edge_indices)
          Create a new GraphPerspective with just the given Nodes and Edges (and all Nodes incident on the given Edges).
 GraphPerspective createGraphPerspective(Node[] nodes, Edge[] edges)
          Create a new GraphPerspective with just the given Nodes and Edges (and all Nodes incident on the given Edges).
 int createNode()
          Create a new Node in this RootGraph, and return its index.
 int createNode(GraphPerspective perspective)
          Create a new Node in this RootGraph, and return its index.
 int createNode(int[] node_indices, int[] edge_indices)
          Create a new Node in this RootGraph, and return its index.
 int createNode(Node[] nodes, Edge[] edges)
          Create a new Node in this RootGraph, and return its index.
 int[] createNodes(int new_node_count)
          Deprecated. Use createNode() instead.
 boolean edgeExists(int from_node_index, int to_node_index)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways: this method returns true if and only if either 1) there exists a directed edge E in this RootGraph such that from_node_index is E's source node's index and to_node_index is E's target node's index or 2) there exists an undirected edge E in this RootGraph such that E's endpoint nodes have indices from_node_index and to_node_index.
 boolean edgeExists(Node from, Node to)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways: this method returns true if and only if either 1) there exists a directed edge E in this RootGraph such that the from node specified is E's source node and the target node specified is E's target node or 2) there exists an undirected edge E in this RootGraph such that E's endpoints are the from and to nodes specified.
 List edgeMetaChildrenList(int node_index)
          Deprecated. Use getEdgeMetaChildIndicesArray(int) instead.
 List edgeMetaChildrenList(Node node)
          Deprecated. Use getEdgeMetaChildIndicesArray(int) instead.
 List edgeMetaParentsList(int edge_index)
          Deprecated. Use getEdgeMetaParentIndicesArray(int) instead.
 Iterator edgesIterator()
          Returns an Iterator over all giny.model.Edge objects in this RootGraph.
 List edgesList()
          Returns a list of Edge objects.
 List edgesList(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 List edgesList(Node from, Node to)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 void ensureCapacity(int nodes, int edges)
          Deprecated. Please don't call this silly method; implementors: I suggest creating an easter egg and having it take effect when this method is called.
 int[] getAdjacentEdgeIndicesArray(int node_index, boolean undirected_edges, boolean incoming_directed_edges, boolean outgoing_directed_edges)
          Returns indices of all edges adjacent to the node at specified index.
 int[] getChildlessMetaDescendants(int node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getConnectingEdgeIndicesArray(int[] node_indices)
          This will return an array of edge indices that are the edges between nodes.
 int[] getConnectingNodeIndicesArray(int[] edge_indices)
          Deprecated. Use getEdgeSourceIndex(int) and getEdgeTargetIndex(int) instead, or use createGraphPerspective(int[], int[]).
 int getDegree(int node_index)
          Return the number of distinct Edges incident on the Node with the given index.
 int getDegree(Node node)
          Return the number of distinct Edges incident on the given Node.
 Edge getEdge(int edge_index)
          Return the Edge with the given index in this RootGraph.
 int getEdgeCount()
          Returns number of edges in this RootGraph.
 int getEdgeCount(int from_node_index, int to_node_index, boolean count_undirected_edges)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 int getEdgeCount(Node from, Node to, boolean count_undirected_edges)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 int[] getEdgeIndicesArray()
          Returns an array of edge indices.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges, boolean include_both_directions)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.
 int[] getEdgeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getEdgeMetaParentIndicesArray(int edge_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int getEdgeSourceIndex(int edge_index)
          Retrieve the index of the Node that is the source of the Edge with the given index.
 int getEdgeTargetIndex(int edge_index)
          Retrieve the index of the Node that is the target of the Edge with the given index.
 int getInDegree(int node_index)
          Return the number of Edges e such that e.getTarget().equals( node ).
 int getInDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e such that e.getSource().equals( node ).
 int getInDegree(Node node)
          Return the number of Edges e such that e.getTarget().equals( node ).
 int getInDegree(Node node, boolean count_undirected_edges)
          Return the number of Edges e such that e.getSource().equals( node ).
 int getIndex(Edge edge)
          Return the index of the given Edge.
 int getIndex(Node node)
          Return the index of the given Node.
 Node getNode(int node_index)
          Return the Node with the given index in this RootGraph.
 int getNodeCount()
          Returns number of nodes in this RootGraph.
 int[] getNodeIndicesArray()
          Returns an array of node indices.
 int[] getNodeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getNodeMetaChildIndicesArray(int node_index, boolean recursive)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] getNodeMetaParentIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int getOutDegree(int node_index)
          Return the number of Edges esuch that e.getSource().equals( node ).
 int getOutDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e such that e.getSource().equals( node ).
 int getOutDegree(Node node)
          Return the number of Edges e such that e.getSource().equals( node ).
 int getOutDegree(Node node, boolean count_undirected_edges)
          Return the number of Edges e such that e.getSource().equals( node ).
 boolean isEdgeDirected(int edge_index)
          Retrieve the directedness of the Edge with the given index.
 boolean isEdgeMetaChild(int parent_index, int child_edge_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isEdgeMetaParent(int child_edge_index, int parent_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaChild(Node parent, Edge child)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaChild(Node parent, Node child)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaParent(Edge child, Node parent)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isMetaParent(Node child, Node parent)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isNeighbor(int a_node_index, int another_node_index)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns true if and only if node at index a_node_index is a "node neighbor" of node at index another_node_index in this RootGraph.
 boolean isNeighbor(Node a_node, Node another_node)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns true if and only if a_node is a "node neighbor" of another_node in this RootGraph.
 boolean isNodeMetaChild(int parent_index, int child_node_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isNodeMetaChild(int parent_index, int child_node_index, boolean recursive)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 boolean isNodeMetaParent(int child_node_index, int parent_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 List metaParentsList(Edge edge)
          Deprecated. Use getEdgeMetaParentIndicesArray(int) instead.
 List metaParentsList(Node node)
          Deprecated. Use getNodeMetaParentIndicesArray(int) instead.
 List neighborsList(Node node)
          Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns a non-repeating list of all nodes N in this RootGraph such that N is a "node neighbor" of node, the input parameter.
 List nodeMetaChildrenList(int parent_index)
          Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 List nodeMetaChildrenList(Node node)
          Deprecated. Use getNodeMetaChildIndicesArray(int) instead.
 List nodeMetaParentsList(int node_index)
          Deprecated. Use getNodeMetaParentIndicesArray(int) instead.
 Iterator nodesIterator()
          Returns an Iterator over all giny.model.Node objects in this RootGraph.
 List nodesList()
          Returns a list of Node objects.
 Edge removeEdge(Edge edge)
          Remove the given Edge from this RootGraph and all of its GraphPerspectives.
 int removeEdge(int edge_index)
          Remove the Edge with the given index from this RootGraph and all of its GraphPerspectives.
 boolean removeEdgeMetaChild(int parent_index, int child_edge_index)
           
 int[] removeEdges(int[] edge_indices)
          Deprecated. Use removeEdge(int) instead.
 List removeEdges(List edges)
          Deprecated. Use removeEdge(Edge) or removeEdges(int[]) instead.
 int removeNode(int node_index)
          Remove the Node with the given index (and all of that Node's incident Edges) from this RootGraph and all of its GraphPerspectives.
 Node removeNode(Node node)
          Remove the given Node and all Edges incident on it from this RootGraph and all of its GraphPerspectives.
 boolean removeNodeMetaChild(int parent_index, int child_node_index)
           
 int[] removeNodes(int[] node_indices)
          Deprecated. Use removeNode(int) instead.
 List removeNodes(List nodes)
          Deprecated. Use removeNode(Node) or removeNodes(int[]) instead.
 

Method Detail

createGraphPerspective

GraphPerspective createGraphPerspective(Node[] nodes,
                                        Edge[] edges)
Create a new GraphPerspective with just the given Nodes and Edges (and all Nodes incident on the given Edges).

TECHNICAL DETAIL: Each Node in the Node array input parameter should be a Node that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. Likewise, each Edge in the Edge array input parameter should be an Edge that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
nodes - A [possibly null] array of Nodes in this RootGraph to include in the new GraphPerspective
edges - A [possibly null] array of Edges in this RootGraph to include in the new GraphPerspective
Returns:
a new GraphPerspective on this RootGraph containing only the given Nodes and Edges, plus any Nodes incident on the given Edges array but omitted from the given Nodes array; returns null if any of the specified Nodes or Edges are not in this RootGraph.

createGraphPerspective

GraphPerspective createGraphPerspective(int[] node_indices,
                                        int[] edge_indices)
Create a new GraphPerspective with just the given Nodes and Edges (and all Nodes incident on the given Edges).

Parameters:
node_indices - A [possibly null] array of indices of Nodes in this RootGraph to include in the new GraphPerspective
edge_indices - A [possibly null] array of indices of Edges in this RootGraph to include in the new GraphPerspective
Returns:
a new GraphPerspective on this RootGraph containing only Nodes and Edges with the given indices, including all Nodes incident on those Edges; returns null if any of the specified Node or Edge indices do not correspond to Nodes or Edges existing in this RootGraph.

ensureCapacity

void ensureCapacity(int nodes,
                    int edges)
Deprecated. Please don't call this silly method; implementors: I suggest creating an easter egg and having it take effect when this method is called.


getNodeCount

int getNodeCount()
Returns number of nodes in this RootGraph. A call to nodesIterator() will return an Iterator containing exactly getNodeCount() elements (unless nodes are created or removed in the meantime).

Returns:
the number of nodes in this RootGraph.

getEdgeCount

int getEdgeCount()
Returns number of edges in this RootGraph. A call to edgesIterator() will return an iterator containing exactly getEdgeCount() elements (unless nodes or edges are created or removed in the meantime).

Returns:
the number of edges in this RootGraph.

nodesIterator

Iterator nodesIterator()
Returns an Iterator over all giny.model.Node objects in this RootGraph.

TECHNICAL DETAIL: Iterating over the set of all nodes in a RootGraph and manipulating a RootGraph's topology (by calling removeXXX() and createXXX() methods) concurrently will have undefined effects on the returned Iterator.

Returns:
an Iterator over the Nodes in this graph; each Object in the returned Iterator is of type giny.model.Node.

nodesList

List nodesList()
Returns a list of Node objects.

See Also:
nodesIterator()

getNodeIndicesArray

int[] getNodeIndicesArray()
Returns an array of node indices.

See Also:
nodesIterator(), GraphObject.getRootGraphIndex()

edgesIterator

Iterator edgesIterator()
Returns an Iterator over all giny.model.Edge objects in this RootGraph.

TECHNICAL DETAIL: Iterating over the set of all edges in a RootGraph and manipulating a RootGraph's topology (by calling removeXXX() and createXXX() methods) concurrently will have undefined effects on the returned Iterator.

Returns:
an Iterator over the Edges in this graph; each Object in the returned Iterator is of type giny.model.Edge.

edgesList

List edgesList()
Returns a list of Edge objects.

See Also:
edgesIterator()

getEdgeIndicesArray

int[] getEdgeIndicesArray()
Returns an array of edge indices.

See Also:
edgesIterator(), GraphObject.getRootGraphIndex()

removeNode

Node removeNode(Node node)
Remove the given Node and all Edges incident on it from this RootGraph and all of its GraphPerspectives.

TECHNICAL DETAIL: The Node input parameter should be a Node that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

IMPORTANT! The returned Node object, if not null, should not be used to query fields by calling methods on that returned Node object - the returned Node's behavior is completely undefined. For example, an implementation of RootGraph may choose to return a Node object whose getRootGraphIndex() method returns a positive value. The purpose of the return value of this method is purely to mark "success" or "not success" - in fact, if this API were redesigned, the return value of this operation would become a boolean value.

Parameters:
node - The Node to remove.
Returns:
A non-null Node marking a successful removal, or null if specified Node does not belong to this RootGraph.

removeNode

int removeNode(int node_index)
Remove the Node with the given index (and all of that Node's incident Edges) from this RootGraph and all of its GraphPerspectives.

Parameters:
node_index - The index in this RootGraph of the Node to remove.
Returns:
The index of the removed Node, or 0 if the given index does not correspond to an existing Node in this RootGraph.

removeNodes

List removeNodes(List nodes)
Deprecated. Use removeNode(Node) or removeNodes(int[]) instead.

See Also:
removeNode(Node), removeNodes(int[])

removeNodes

int[] removeNodes(int[] node_indices)
Deprecated. Use removeNode(int) instead.

Remove the Nodes with the given indices (and all of those Nodes' incident Edges) from this RootGraph and all of its GraphPerspectives.

Parameters:
node_indices - An non-null array of the indices in this RootGraph of the Nodes to remove.
Returns:
An int array of equal length to the argument array, and with equal values except at positions that in the input array contain indices corresponding to Nodes that don't exist in this RootGraph; at these positions the result array will contain the value 0.
See Also:
removeNode(int)

createNode

int createNode()
Create a new Node in this RootGraph, and return its index.

Returns:
the index of the newly created Node.

createNode

int createNode(Node[] nodes,
               Edge[] edges)
Create a new Node in this RootGraph, and return its index. The new Node will be a MetaParent to the Nodes and Edges given, and also to any Nodes incident on the given Edges but omitted from the array.

TECHNICAL DETAIL: The Node and Edge input parameters should be objects that were previously returned by methods of this RootGraph or by methods of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
nodes - a [possibly null] array of Nodes that will be MetaChildren of the newly created Node.
edges - a [possibly null] array of Edges that will be MetaChildren of the newly created Node.
Returns:
the index of the newly created Node, or 0 if any of the given Nodes or Edges are not in this RootGraph.

createNode

int createNode(GraphPerspective perspective)
Create a new Node in this RootGraph, and return its index.

TECHNICAL DETAIL: The GraphPerspective input parameter should be an object that was previously returned by this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
perspective - a [possibly null] GraphPerspective of this RootGraph, containing the Nodes and Edges that will be MetaChildren of the newly created Node.
Returns:
the index of the newly created Node, or 0 if the given GraphPerspective is not a perspective on this RootGraph.

createNode

int createNode(int[] node_indices,
               int[] edge_indices)
Create a new Node in this RootGraph, and return its index. The new Node will be a MetaParent to the Nodes and Edges with the given indices, and also to any Nodes incident on the given Edges but omitted from the array.

Parameters:
node_indices - a [possibly null] array of the indices in this RootGraph of the Nodes that will be MetaChildren of the newly created Node.
edge_indices - a [possibly null] array of the indices in this RootGraph of the Edges that will be MetaChildren of the newly created Node.
Returns:
the index of the newly created Node, or 0 if any node or edge index specified is not a valid index of node or edge [respectively] in this RootGraph.

createNodes

int[] createNodes(int new_node_count)
Deprecated. Use createNode() instead.

Create new_node_count new Nodes in this RootGraph, and return their indices.

Parameters:
new_node_count - the number of new nodes to create.
Returns:
an array of length new_node_count containing the indices of the newly created Nodes.
See Also:
createNode()

removeEdge

Edge removeEdge(Edge edge)
Remove the given Edge from this RootGraph and all of its GraphPerspectives.

TECHNICAL DETAIL: The Edge input parameter should be an Edge that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

IMPORTANT! The returned Edge object, if not null, should not be used to query fields by calling methods on that returned Edge object - the returned Edge's behavior is completely undefined. For example, an implementation of RootGraph may choose to return an Edge object whose getRootIndex() methods returns a positive value. The purpose of the return value of this method is purely to mark "success" or "not success" - in fact, if this API were redesigned, the return value of this operation would become a boolean value.

Parameters:
edge - The Edge to remove.
Returns:
A non-null Edge marking a successful removal, or null if the specified Edge does not belong to this RootGraph.

removeEdge

int removeEdge(int edge_index)
Remove the Edge with the given index from this RootGraph and all of its GraphPerspectives.

Parameters:
edge_index - The index in this RootGraph of the Edge to remove.
Returns:
The index of the removed Edge, or 0 if the given index does not correspond to an existing Edge in this RootGraph.

removeEdges

List removeEdges(List edges)
Deprecated. Use removeEdge(Edge) or removeEdges(int[]) instead.

See Also:
removeEdge(Edge), removeEdges(int[])

removeEdges

int[] removeEdges(int[] edge_indices)
Deprecated. Use removeEdge(int) instead.

Remove the Edges with the given indices from this RootGraph and all of its GraphPerspectives.

Parameters:
edge_indices - A non-null array of the indices in this RootGraph of the Edges to remove.
Returns:
An array of equal length to the argument array, and with equal values except at positions that in the input array contain indices corresponding to Edges that don't exist in this RootGraph; at these positions the result array will contain the value 0.
See Also:
removeEdge(int)

createEdge

int createEdge(Node source,
               Node target)
Create a directed Edge from the given source Node to the given target Node, and return its index. This edge created will be directed, except in the case where the source and target nodes are the same node, in which case the created edge will be undirected.

TECHNICAL DETAIL: Each of the two Node input parameters should be a Node that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
source - the source of the new directed Edge
target - the target of the new directed Edge
Returns:
the index of the newly created Edge, or 0 if either the source or target Node is not in this RootGraph.

createEdge

int createEdge(Node source,
               Node target,
               boolean directed)
Create an Edge from the given source Node to the given target Node, and return its index. The newly created Edge will be directed iff the boolean argument is true.

TECHNICAL DETAIL: Each of the two Node input parameters should be a Node that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
source - the source of the new Edge
target - the target of the new Edge
directed - The new Edge will be directed iff this argument is true.
Returns:
the index of the newly created Edge, or 0 if either the source or target Node is not in this RootGraph.

createEdge

int createEdge(int source_index,
               int target_index)
Create a directed Edge from the Node with the given source_index to the Node with the given target_index, and return the new Edge's index. This edge created will be directed, except in the case where the source and target nodes are the same node, in which case the created edge will be undirected.

Parameters:
source_index - the index in this RootGraph of the source of the new directed Edge
target_index - the index in this RootGraph of the target of the new directed Edge
Returns:
the index of the newly created Edge, or 0 if either the source node index or the target node index does not correspond to an existing Node in this RootGraph.

createEdge

int createEdge(int source_index,
               int target_index,
               boolean directed)
Create an Edge from the Node with the given source_index to the Node with the given target_index, and return the new Edge's index. The newly created Edge will be directed iff the boolean argument is true.

Parameters:
source_index - the index in this RootGraph of the source of the new Edge
target_index - the index in this RootGraph of the target of the new Edge
directed - The new Edge will be directed iff this argument is true.
Returns:
the index of the newly created Edge, or 0 if either the source node index or the target node index does not correspond to an existing Node in this RootGraph.

createEdges

int[] createEdges(int[] source_indices,
                  int[] target_indices,
                  boolean directed)
Deprecated. Use createEdge(int, int, boolean) instead.

Create some Edges. The indices of the sources and the targets are given in two arrays, which must be of equal length, and the indices of the created edges are returned in an array of the same length. The newly created Edges will be directed iff the boolean argument is true.

If returnArr represents the int[] that is returned by this method, then returnArr[i] defines the index of newly created edge whose source node index is source_indices[i] and whose target node index is target_indices[i].

Parameters:
source_indices - a non-null array of the indices of the source Nodes for the new Edges.
target_indices - a non-null array of length source_indices.length of the indices of the target Nodes for the new Edges.
directed - The new Edges will be directed iff this argument is true.
Returns:
an array of length source_indices.length of the indices of the newly created Edges; an entry of 0 in the returned array corresponds an ill-defined source or target node index within the input parameters, at the same array offset.
See Also:
createEdge(int, int, boolean)

containsNode

boolean containsNode(Node node)
Return true if the given Node is in this RootGraph. False otherwise.

TECHNICAL DETAIL: The Node input parameter should be an object that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Returns:
true iff the given Node is in this RootGraph.

containsEdge

boolean containsEdge(Edge edge)
Return true if the given Edge is in this RootGraph. False otherwise.

TECHNICAL DETAIL: The Edge input parameter should be an object that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Returns:
true iff the given Edge is in this RootGraph.

neighborsList

List neighborsList(Node node)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns a non-repeating list of all nodes N in this RootGraph such that N is a "node neighbor" of node, the input parameter.

See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

isNeighbor

boolean isNeighbor(Node a_node,
                   Node another_node)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns true if and only if a_node is a "node neighbor" of another_node in this RootGraph.

See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

isNeighbor

boolean isNeighbor(int a_node_index,
                   int another_node_index)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways, please note that the definition of "node neighbor" is such: Node A is a "node neighbor" of node B if and only if there exists an edge [directed or undirected] E such that A is E's target and B is E's source, or A is E's source and B is E's target; this method then returns true if and only if node at index a_node_index is a "node neighbor" of node at index another_node_index in this RootGraph.

See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

edgeExists

boolean edgeExists(Node from,
                   Node to)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways: this method returns true if and only if either 1) there exists a directed edge E in this RootGraph such that the from node specified is E's source node and the target node specified is E's target node or 2) there exists an undirected edge E in this RootGraph such that E's endpoints are the from and to nodes specified.

See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

edgeExists

boolean edgeExists(int from_node_index,
                   int to_node_index)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead; if you decide to use this method anyways: this method returns true if and only if either 1) there exists a directed edge E in this RootGraph such that from_node_index is E's source node's index and to_node_index is E's target node's index or 2) there exists an undirected edge E in this RootGraph such that E's endpoint nodes have indices from_node_index and to_node_index.

See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

getEdgeCount

int getEdgeCount(Node from,
                 Node to,
                 boolean count_undirected_edges)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Count the number of edges from the first Node to the second. Note that if count_undirected_edges is false, any Edge e such that e.isDirected() == false will not be included in the count.

Parameters:
from - the Node that is the source of the edges to be counted.
to - the Node that is the target of the edges to be counted.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the number of Edges from the from Node to the to Node; returns -1 if either the from or the to Node is not in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

getEdgeCount

int getEdgeCount(int from_node_index,
                 int to_node_index,
                 boolean count_undirected_edges)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Count the number of edges from the Node with index from_index to the Node with index to_index (where this.getIndex( to_node ) == to_index). Note that if count_undirected_edges is false, any Edge e such that e.isDirected() == false will not be included in the count.

Parameters:
from_node_index - the index of the Node to count edges from.
to_node_index - the index of the Node to find edges to.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the number of Edges from the Node with index from_index to the Node with index to_index; returns -1 if either one of the two specified nodes is not in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

getAdjacentEdgeIndicesArray

int[] getAdjacentEdgeIndicesArray(int node_index,
                                  boolean undirected_edges,
                                  boolean incoming_directed_edges,
                                  boolean outgoing_directed_edges)
Returns indices of all edges adjacent to the node at specified index. See definitions of adjacency below.

Parameters:
node_index - the index of the node whose adjacent edge information we're seeking.
undirected_edges - edge indices of all adjacent undirected edges are included in the return value of this method if this value is true, otherwise not a single index corresponding to an undirected edge is returned; undirected edge E is an adjacent undirected edge to node N [definition:] if and only if E's source is N or E's target is N.
incoming_directed_edges - edge indices of all incoming directed edges are included in the return value of this method if this value is true, otherwise not a single index corresponding to an incoming directed edge is returned; directed edge E is an incoming directed edge to node N [definition:] if and only if N is E's target.
outgoing_directed_edges - edge indices of all outgoing directed edges are included in the return value of this method if this value is true, otherwise not a single index corresponding to an outgoing directed edge is returned; directed edge E is an outgoing directed edge from node N [definition:] if and only if N is E's source.
Returns:
a set of edge indices corresponding to edges matched by our query; if all three of the boolean query parameters are false, the empty array is returned; null is returned if and only if this RootGraph has no node at the specified index.

getConnectingEdgeIndicesArray

int[] getConnectingEdgeIndicesArray(int[] node_indices)
This will return an array of edge indices that are the edges between nodes. The input node indices array need not be non-repeating. Returns null if any one of the node indices specified does not correspond to a node in this RootGraph.


getConnectingNodeIndicesArray

int[] getConnectingNodeIndicesArray(int[] edge_indices)
Deprecated. Use getEdgeSourceIndex(int) and getEdgeTargetIndex(int) instead, or use createGraphPerspective(int[], int[]).

Return the nodes that connect the given edges. The input edge indices array need not be non-repeating. Returns null if any one of the edge indices specified does not correspond to an edge in this RootGraph.

See Also:
getEdgeSourceIndex(int), getEdgeTargetIndex(int), createGraphPerspective(int[], int[])

getEdgeIndicesArray

int[] getEdgeIndicesArray(int from_node_index,
                          int to_node_index,
                          boolean include_undirected_edges,
                          boolean include_both_directions)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Returns:
null is returned if either of the specified Nodes is not in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

edgesList

List edgesList(Node from,
               Node to)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Return a new List of the Edges from the first given Node to the second given Node.

Parameters:
from - the Node that is the source of the Edges to be returned.
to - the Node that is the target of the Edges to be returned.
Returns:
a new List of the Edges from the from Node to the to Node, or the empty List if none exist; null is returned if either of the specified nodes is not in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

edgesList

List edgesList(int from_node_index,
               int to_node_index,
               boolean include_undirected_edges)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Return an array of the indices of all Edges from the Node with the first given index to the Node with the second given index.

Parameters:
from_node_index - the index of the Node to return edges from.
to_node_index - the index of the Node to return edges to.
include_undirected_edges - Undirected edges will be included in the List iff include_undirected_edges is true.
Returns:
a new List of the Edges from the Node corresponding to from_node_index to the Node corresponding to to_node_index, or the empty List if none exist; null is returned if either of the specified nodes does not exist in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

getEdgeIndicesArray

int[] getEdgeIndicesArray(int from_node_index,
                          int to_node_index,
                          boolean include_undirected_edges)
Deprecated. Use getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean) instead.

Return an array of the indices of all Edges from the Node with the first given index to the Node with the second given index.

Parameters:
from_node_index - the index of the Node to return edges from.
to_node_index - the index of the Node to return edges to.
include_undirected_edges - Undirected edges will be included in the array iff include_undirected_edges is true.
Returns:
an array of the Edges from the Node corresponding to from_node_index to the Node corresponding to to_node_index; the empty array is returned if none exist; null is returned if either of the specified Nodes does not exist in this RootGraph.
See Also:
getAdjacentEdgeIndicesArray(int, boolean, boolean, boolean)

getInDegree

int getInDegree(Node node)
Return the number of Edges e such that e.getTarget().equals( node ). Note that this includes undirected edges, so it will not always be the case that getInDegree( node ) + getOutDegree( node ) == getDegree( node ).

Parameters:
node - the Node to count in-edges of.
Returns:
the in-degree of the given Node, or -1 if the specified Node is not in this RootGraph.

getInDegree

int getInDegree(int node_index)
Return the number of Edges e such that e.getTarget().equals( node ). Note that this includes undirected edges, so it will not always be the case that getInDegree( node ) + getOutDegree( node ) == getDegree( node ).

Parameters:
node_index - the index of the Node to count in-edges of.
Returns:
the in-degree of the Node with the given index, or -1 if this RootGraph has no Node with specified index.

getInDegree

int getInDegree(Node node,
                boolean count_undirected_edges)
Return the number of Edges e such that e.getSource().equals( node ). Note that if count_undirected_edges is true, this includes undirected edges, so it will not always be the case that getInDegree( node, true ) + getOutDegree( node, true ) == getDegree( node ), but it will always be the case that getInDegree( node, true ) + getOutDegree( node, false ) == getDegree( node ).

Parameters:
node - the Node to count in-edges of.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the in-degree of the given Node or -1 if specified Node is not in this RootGraph.

getInDegree

int getInDegree(int node_index,
                boolean count_undirected_edges)
Return the number of Edges e such that e.getSource().equals( node ). Note that if count_undirected_edges is true, this includes undirected edges, so it will not always be the case that getInDegree( node, true ) + getOutDegree( node, true ) == getDegree( node ), but it will always be the case that getInDegree( node, true ) + getOutDegree( node, false ) == getDegree( node ).

Parameters:
node_index - the index of the Node to count in-edges of.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the in-degree of the Node with the given index or -1 if this RootGraph has no Node at specified index.

getOutDegree

int getOutDegree(Node node)
Return the number of Edges e such that e.getSource().equals( node ). Note that this includes undirected edges, so it will not always be the case that getInDegree( node ) + getOutDegree( node ) == getDegree( node ).

Parameters:
node - the Node to count out-edges of.
Returns:
the out-degree of the given Node, or -1 if specified Node is not in this RootGraph.

getOutDegree

int getOutDegree(int node_index)
Return the number of Edges esuch that e.getSource().equals( node ). Note that this includes undirected edges, so it will not always be the case that getInDegree( node ) + getOutDegree( node ) == getDegree( node ).

Parameters:
node_index - the index of the Node to count out-edges of.
Returns:
the out-degree of the Node with the given index or -1 if index specified does not correspond to a Node in this RootGraph.

getOutDegree

int getOutDegree(Node node,
                 boolean count_undirected_edges)
Return the number of Edges e such that e.getSource().equals( node ). Note that if count_undirected edges is true, this includes undirected edges, so it will not always be the case that getInDegree( node, true ) + getOutDegree( node, true ) == getDegree( node ), but it will always be the case that getInDegree( node, true ) + getOutDegree( node, false ) == getDegree( node ).

Parameters:
node - the Node to count out-edges of.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the out-degree of the given Node or -1 if specified Node is not in this RootGraph.

getOutDegree

int getOutDegree(int node_index,
                 boolean count_undirected_edges)
Return the number of Edges e such that e.getSource().equals( node ). Note that if count_undirected edges is true, this includes undirected edges, so it will not always be the case that getInDegree( node, true ) + getOutDegree( node, true ) == getDegree( node ), but it will always be the case that getInDegree( node, true ) + getOutDegree( node, false ) == getDegree( node ).

Parameters:
node_index - the index of the Node to count out-edges of.
count_undirected_edges - Undirected edges will be included in the count iff count_undirected_edges is true.
Returns:
the out-degree of the Node with the given index or -1 if this RootGraph has no Node with specified index.

getDegree

int getDegree(Node node)
Return the number of distinct Edges incident on the given Node. By 'distinct' we mean that no Edge will be counted twice, even if it is undirected.

Returns:
the degree of the given Node or -1 if specified Node is not in this RootGraph.

getDegree

int getDegree(int node_index)
Return the number of distinct Edges incident on the Node with the given index. By 'distinct' we mean that no Edge will be counted twice, even if it is undirected.

Returns:
the degree of the Node with the given index or -1 if this RootGraph has no Node with specified index.

getIndex

int getIndex(Node node)
Return the index of the given Node. Each Node has a unique index which is guaranteed to remain the same throughout the lifetime of the Node and its RootGraph. Node indices are always <= -1, and are not guaranteed to be contiguous. This method simply returns node.getRootGraphIndex() after checking that it is in this RootGraph.

TECHNICAL DETAIL: The Node input parameter should be an object that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
node - the Node to find a corresponding index for.
Returns:
the index of the given Node in this RootGraph or 0 if it is not in this RootGraph.

getNode

Node getNode(int node_index)
Return the Node with the given index in this RootGraph. All indices are <= -1. Some indices may correspond to no node, but no index may correspond to multiple nodes. The index of a Node will not change for the lifetime of the Node and its RootGraph.

Parameters:
node_index - the index in this RootGraph of to find a corresponding Node for.
Returns:
the Node with the given index in this RootGraph, or null if there is no Node with the given index.

getIndex

int getIndex(Edge edge)
Return the index of the given Edge. Each Edge has a unique index which is guaranteed to remain the same throughout the lifetime of the Edge and its RootGraph. Edge indices are always <= -1, and are not guaranteed to be contiguous. This method simply returns edge.getRootGraphIndex() after checking that it is in this RootGraph.

TECHNICAL DETAIL: The Edge input parameter should be an object that was previously returned by a method of this RootGraph or by a method of another component that this RootGraph system defines. If this is not the case, results of calling this method are undefined.

Parameters:
edge - the Edge to find a corresponding index for.
Returns:
the index of the given Edge in this RootGraph or 0 if it is not in this RootGraph.

getEdge

Edge getEdge(int edge_index)
Return the Edge with the given index in this RootGraph. All indices are <= -1. Some indices may correspond to no edge, but no index may correspond to multiple edges. The index of a Edge will not change for the lifetime of the Edge and its RootGraph.

Parameters:
edge_index - the index in this RootGraph of to find a corresponding Edge for.
Returns:
the Edge with the given index in this RootGraph, or null if there if there is no Edge with the given index.

getEdgeSourceIndex

int getEdgeSourceIndex(int edge_index)
Retrieve the index of the Node that is the source of the Edge with the given index. Note that if the edge is undirected, the edge also connects the target to the source.

Parameters:
edge_index - the index in this RootGraph of the Edge
Returns:
the index in this RootGraph of the Edge's source Node or 0 if there's no Edge at specified index in this RootGraph.

getEdgeTargetIndex

int getEdgeTargetIndex(int edge_index)
Retrieve the index of the Node that is the target of the Edge with the given index. Note that if the edge is undirected, the edge also connects the target to the source.

Parameters:
edge_index - the index in this RootGraph of the Edge
Returns:
the index in this RootGraph of the Edge's target Node or 0 if there's no Edge at specified index in this RootGraph.

isEdgeDirected

boolean isEdgeDirected(int edge_index)
Retrieve the directedness of the Edge with the given index. Note that if the edge is undirected, the edge also connects the target to the source.

Parameters:
edge_index - the index in this RootGraph of the Edge
Returns:
true iff the edge is directed; if no Edge at specified index exists in this RootGraph, the result of this method is undefined.

addMetaChild

boolean addMetaChild(Node parent,
                     Node child)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. addMetaChild establishes a contains-a relationship between the first argument (the parent) and the second argument (the child). It returns true unless the meta relationship already existed or unless either the parent or child spcified is not in this RootGraph.

Parameters:
parent - the Node that is to be the parent (the container) in the contains-a relationship that we are creating.
child - the Node that is to be the child (the containee) in the contains-a relationship that we are creating.
Returns:
true unless they were already meta-parent, meta-child to each other or unless parent or child not in this RootGraph.

addNodeMetaChild

boolean addNodeMetaChild(int parent_index,
                         int child_node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. addMetaChild establishes a contains-a relationship between the Node corresponding to the first argument (parent_index) and the Node corresponding to the second argument (child_index). It returns true unless the meta relationship already existed or unless either of the indices specified does not correspond to a node in this RootGraph.

Parameters:
parent_index - the index in this RootGraph of the Node that is to be the parent (the container) in the contains-a relationship that we are creating.
child_node_index - the index in this RootGraph of the Node that is to be the child (the containee) in the contains-a relationship that we are creating.
Returns:
true unless they were already meta-parent, meta-child to each other or unless either of them isn't in this RootGraph.

removeNodeMetaChild

boolean removeNodeMetaChild(int parent_index,
                            int child_node_index)

isMetaParent

boolean isMetaParent(Node child,
                     Node parent)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaParents. isMetaParent returns true iff the second argument (parent) is an MetaParent of the first argument (child).

Parameters:
child - the Node that is the child (the containee) in the contains-a relationship that we are querying.
parent - the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
true iff the latter argument is a MetaParent of the former argument.

isNodeMetaParent

boolean isNodeMetaParent(int child_node_index,
                         int parent_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaParents. isMetaParent returns true iff the Node corresponding to the second argument (parent_index) is a MetaParent of the Node corresponding to the first argument (child_index).

Parameters:
child_node_index - the index of the Node that is the child (the containee) in the contains-a relationship that we are querying.
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
true iff the Node corresponding to the latter argument is an MetaParent of the Node corresponding to the former argument.

metaParentsList

List metaParentsList(Node node)
Deprecated. Use getNodeMetaParentIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaParents. metaParentsList returns a new List of the MetaParents of the given Node. If there are no MetaParents then the result will be the empty List; if node does not exist in this RootGraph the result will be null.

Parameters:
node - the Node that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that contain the given Node, or null if specified Node is not in this RootGraph.
See Also:
getNodeMetaParentIndicesArray(int)

nodeMetaParentsList

List nodeMetaParentsList(int node_index)
Deprecated. Use getNodeMetaParentIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaParents. nodeMetaParentsList returns a new List of the MetaParents of the Node with the given index. If there are no MetaParents then the result will be the empty List; null is returned if the specified node does not exist in this RootGraph.

Parameters:
node_index - the index of the Node that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that contain the Node with the given index, or null if the specified node does not exist.
See Also:
getNodeMetaParentIndicesArray(int)

getNodeMetaParentIndicesArray

int[] getNodeMetaParentIndicesArray(int node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaParents. getNodeMetaParentIndicesArray returns an array of the MetaParents of the Node with the given index. If there are no MetaParents then the result will be the empty array; null is returnd if the specified index does not correspond to a Node existing in this RootGraph.

Parameters:
node_index - the index of the Node that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
an array of the indices of the Nodes that contain the Node with the given index, or null if specified node does not exist.

isMetaChild

boolean isMetaChild(Node parent,
                    Node child)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. isMetaChild returns true iff the second argument (child) is an MetaChild of the first argument (parent).

Parameters:
parent - the Node that is the parent (the container) in the contains-a relationship that we are querying.
child - the Node that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
true iff the latter argument is a MetaChild of the former argument.

isNodeMetaChild

boolean isNodeMetaChild(int parent_index,
                        int child_node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. Returns true iff the Node corresponding to the second argument (child_index) is a MetaChild of the Node corresponding to the first argument (parent_index).

Parameters:
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
child_node_index - the index of the Node that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
true iff the Node corresponding to the latter argument is an MetaChild of the Node corresponding to the former argument.

isNodeMetaChild

boolean isNodeMetaChild(int parent_index,
                        int child_node_index,
                        boolean recursive)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. isMetaChild returns true iff the Node corresponding to the second argument (child_index) is a MetaChild of the Node corresponding to the first argument (parent_index).

Parameters:
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
child_node_index - the index of the Node that is the child (the containee) in the contains-a relationship that we are querying.
recursive - if true, the method will look for child_node_index recursively inside descendants of parent_index
Returns:
true iff the Node corresponding to the latter argument is an MetaChild of the Node corresponding to the former argument.

nodeMetaChildrenList

List nodeMetaChildrenList(Node node)
Deprecated. Use getNodeMetaChildIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. nodeMetaChildrenList returns a new List of the MetaChildren of the given Node. If there are no MetaChildren then the result will be the empty List; null is returned if the specified Node is not in this RootGraph.

Parameters:
node - the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that are contained by the given Node, or null if specified node is not in this RootGraph.
See Also:
getNodeMetaChildIndicesArray(int)

nodeMetaChildrenList

List nodeMetaChildrenList(int parent_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. nodeMetaChildrenList returns a new List of the Node MetaChildren of the Node with the given index. If there are no MetaChildren then the result will be the empty list; null is returned if no Node exists in this RootGraph at specified node index.

Parameters:
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that are contained by the Node with the given index, or null if no Node exists at index parent_index.

getNodeMetaChildIndicesArray

int[] getNodeMetaChildIndicesArray(int node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. getNodeMetaChildIndicesArray returns an array of the MetaChildren of the Node with the given index. If there are no MetaChildren then the result will be the empty array; null is returned if no node exists in this RootGraph at index node_index.

Parameters:
node_index - the index of the Node that is the parent (the containee) in the contains-a relationship that we are querying.
Returns:
an array of the indices of the Nodes in this RootGraph that are contained by the Node with the given index.

getNodeMetaChildIndicesArray

int[] getNodeMetaChildIndicesArray(int node_index,
                                   boolean recursive)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. getNodeMetaChildIndicesArray returns an array of the MetaChildren of the Node with the given index. If there are no MetaChildren then the result will be the empty array; null is returned if no Node exists in this RootGraph at index node_index.

Parameters:
node_index - the index of the Node that is the parent (the containee) in the contains-a relationship that we are querying.
recursive - if true, then this method returns all descendants of node_index by recursively searching inside node_index's children
Returns:
an array of the indices of the Nodes in this GraphPerspective that are contained by the Node with the given index.

getChildlessMetaDescendants

int[] getChildlessMetaDescendants(int node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. This method returns an array of node RootGraph indices that belong to Nodes that are [strictly] descendants of Node with node_index and that do not have any children of their own (one could call them leaves, except that this is not a tree).

Parameters:
node_index - the RootGraph index of the node for which childless descendants will be returned
Returns:
an array of node RootGraph indices that belong to Nodes that are descendants of Node with node_index and that do not have any children of their own (one could call them leaves, except that this is not a tree.

addMetaChild

boolean addMetaChild(Node parent,
                     Edge child)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. addMetaChild establishes a contains-a relationship between the first argument (the parent) and the second argument (the child). It returns true unless the meta relationship already existed or unless either parent or child is not in this RootGraph.

Parameters:
parent - the Node that is to be the parent (the container) in the contains-a relationship that we are creating.
child - the Edge that is to be the child (the containee) in the contains-a relationship that we are creating.
Returns:
true unless they were already meta-parent, meta-child to each other or unless either parent or child not in this RootGraph.

addEdgeMetaChild

boolean addEdgeMetaChild(int parent_index,
                         int child_edge_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. addMetaChild establishes a contains-a relationship between the Node corresponding to the first argument (parent_index) and the Edge corresponding to the second argument (child_index). It returns true unless the meta relationship already existed or unless either parent node at specified index or child edge at specified index does not exist in this RootGraph.

Parameters:
parent_index - the index in this RootGraph of the Node that is to be the parent (the container) in the contains-a relationship that we are creating.
child_edge_index - the index in this RootGraph of the Edge that is to be the child (the containee) in the contains-a relationship that we are creating.
Returns:
true unless they were already meta-parent, meta-child to each other or unless either parent or child does not exist in this RootGraph.

removeEdgeMetaChild

boolean removeEdgeMetaChild(int parent_index,
                            int child_edge_index)

isMetaParent

boolean isMetaParent(Edge child,
                     Node parent)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. An Edge may have any number of MetaParents. isMetaParent returns true iff the second argument (parent) is an MetaParent of the first argument (child).

Parameters:
child - the Edge that is the child (the containee) in the contains-a relationship that we are querying.
parent - the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
true iff the latter argument is a MetaParent of the former argument.

isEdgeMetaParent

boolean isEdgeMetaParent(int child_edge_index,
                         int parent_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. An Edge may have any number of MetaParents. isMetaParent returns true iff the Node corresponding to the second argument (parent_index) is a MetaParent of the Edge corresponding to the first argument (child_index).

Parameters:
child_edge_index - the index of the Edge that is the child (the containee) in the contains-a relationship that we are querying.
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
true iff the Node corresponding to the latter argument is an MetaParent of the Edge corresponding to the former argument.

metaParentsList

List metaParentsList(Edge edge)
Deprecated. Use getEdgeMetaParentIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. An Edge may have any number of MetaParents. metaParentsList returns a new List of the MetaParents of the given Edge. If there are no MetaParents then the result will be the empty List; null is returned if specified Edge is not in this RootGraph.

Parameters:
edge - the Edge that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that contain the given Edge.
See Also:
getEdgeMetaParentIndicesArray(int)

edgeMetaParentsList

List edgeMetaParentsList(int edge_index)
Deprecated. Use getEdgeMetaParentIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. An Edge may have any number of MetaParents. EdgeMetaParentsList returns a new List of the MetaParents of the Edge with the given index. If there are no MetaParents then the result will be the empty List; null is returned if no Edge exists in this RootGraph at index edge_index.

Parameters:
edge_index - the index of the Edge that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
a new List of the Nodes that contain the Edge with the given index.
See Also:
getEdgeMetaParentIndicesArray(int)

getEdgeMetaParentIndicesArray

int[] getEdgeMetaParentIndicesArray(int edge_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. An Edge may have any number of MetaParents. getEdgeMetaParentIndicesArray returns an array of the MetaParents of the Edge with the given index. If there are no MetaParents then the result will be the empty array; null is returned if no Edge exists in this RootGraph at index edge_index.

Parameters:
edge_index - the index of the Edge that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
an array of the indices of the Nodes that contain the Edge with the given index.

isMetaChild

boolean isMetaChild(Node parent,
                    Edge child)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. isMetaChild returns true iff the second argument (child) is an MetaChild of the first argument (parent).

Parameters:
parent - the Node that is the parent (the container) in the contains-a relationship that we are querying.
child - the Edge that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
true iff the latter argument is a MetaChild of the former argument.

isEdgeMetaChild

boolean isEdgeMetaChild(int parent_index,
                        int child_edge_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. isMetaChild returns true iff the Edge corresponding to the second argument (child_index) is a MetaChild of the Node corresponding to the first argument (parent_index).

Parameters:
parent_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
child_edge_index - the index of the Edge that is the child (the containee) in the contains-a relationship that we are querying.
Returns:
true iff the Edge corresponding to the latter argument is an MetaChild of the Node corresponding to the former argument.

edgeMetaChildrenList

List edgeMetaChildrenList(Node node)
Deprecated. Use getEdgeMetaChildIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. edgeMetaChildrenList returns a new List of the Edge MetaChildren of the given Node. If there are no Edge MetaChildren then the result will be the empty List; null is returned if the specified Node does not exist in this RootGraph.

Parameters:
node - the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
a new List of the Edges that are contained by the given Node.
See Also:
getEdgeMetaChildIndicesArray(int)

edgeMetaChildrenList

List edgeMetaChildrenList(int node_index)
Deprecated. Use getEdgeMetaChildIndicesArray(int) instead.

Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. edgeMetaChildrenList returns a new List of the Edge MetaChildren of the Node with the given index. If there are no Edge MetaChildren then the result will be the empty List; null is returned if no Node exists in this RootGraph at index node_index.

Parameters:
node_index - the index of the Node that is the parent (the container) in the contains-a relationship that we are querying.
Returns:
a new List of the Edges that are contained by the Node with the given index.
See Also:
getEdgeMetaChildIndicesArray(int)

getEdgeMetaChildIndicesArray

int[] getEdgeMetaChildIndicesArray(int node_index)
Nodes and Edges comprise an additional directed graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges. A Node may have any number of MetaChildren. getEdgeMetaChildIndicesArray returns an array of the MetaChildren of the Node with the given index. If there are no MetaChildren then the result will be the empty array; null is returned if no Node exists in this RootGraph at index node_index.

Parameters:
node_index - the index of the Node that is the parent (the containee) in the contains-a relationship that we are querying.
Returns:
an array of the indices of the Edges that are contained by the Node with the given index.

Cytoscape 2.8.0 API

Copyright 2010 Cytoscape Consortium. All rights reserved.