Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

giny.model
Interface GraphPerspective  view GraphPerspective download GraphPerspective.java


public interface GraphPerspective


Method Summary
 java.lang.Object clone()
          Create a new ColtGraphPerspective with the same RootGraph and a new copy of the rootNodeIndexToPerspectiveNodeIndexMap and rootEdgeIndexToPerspectiveEdgeIndexMap of this one.
 boolean containsEdge(Edge edge)
          Return true if the given Edge is in this GraphPerspective.
 boolean containsEdge(Edge edge, boolean recurse)
          Return true if the given Edge is in this GraphPerspective.
 boolean containsNode(Node node)
          Return true if the given Node is in this GraphPerspective.
 boolean containsNode(Node node, boolean recurse)
          Return true if the given Node is in this GraphPerspective.
 GraphPerspective createGraphPerspective(giny.filter.Filter filter)
          Create a new GraphPerspective with all of the Nodes from this one that pass the given filter and all of the Edges from this one that pass the filter (and all Nodes incident on those edges).
 GraphPerspective createGraphPerspective(int[] node_indices)
          Create a GraphPerspective given a list of nodes.
 GraphPerspective createGraphPerspective(int[] node_indices, int[] edge_indices)
          Create a new GraphPerspective with just the Nodes with the given node_indices and just the Edges with the given edge_indices (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).
 boolean edgeExists(int from_node_index, int to_node_index)
          Determine if there are any Edges in this GraphPerspective from the Node with the first of the given indices to the Node with the second of the given indices.
 boolean edgeExists(Node from, Node to)
          Determine if there are any Edges in this GraphPerspective from the first given Node to the second.
 java.util.List edgeMetaChildrenList(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List edgeMetaChildrenList(Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List edgeMetaParentsList(int edge_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.Iterator edgesIterator()
           
 java.util.List edgesList()
           
 java.util.List edgesList(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.
 java.util.List edgesList(Node from, Node to)
          Return a new List of the Edges in this GraphPerspective from the first given Node to the second given Node.
 int[] getAdjacentEdgeIndicesArray(int node_index, boolean include_undirected_edges, boolean include_both_directions)
          Returns all Adjacent Edges to the given node.
 java.util.List getAdjacentEdgesList(Node node, boolean include_undirected_edges, boolean include_both_directions)
          Returns all Adjacent Edges to the given node.
 int[] getConnectingEdgeIndicesArray(int[] node_indices)
          This will return an array of edge indices that are the edges between nodes
 java.util.List getConnectingEdges(java.util.List nodes)
          This will return an array of edge indices that are the edges between nodes
 int getDegree(int node_index)
          Return the number of distinct Edges in this GraphPerspective incident on the Node with the given index.
 int getDegree(Node node)
          Return the number of distinct Edges in this GraphPerspective incident on the given Node.
 Edge getEdge(int index)
          Return the Edge with the given index in this GraphPerspective.
 int getEdgeCount()
          Returns number of active edges in this perspective.
 int getEdgeCount(int from_node_index, int to_node_index, boolean count_undirected_edges)
          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).
 int getEdgeCount(Node from, Node to, boolean count_undirected_edges)
          Count the number of edges from the first Node to the second.
 int getEdgeIndex(int root_graph_edge_index)
          Return the index in this GraphPerspective of the Edge with the given index in the RootGraph.
 int[] getEdgeIndicesArray()
          Return an array containing the indices in the RootGraph of all Edges in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges)
          Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.
 int[] getEdgeIndicesArray(int from_node_index, int to_node_index, boolean include_undirected_edges, boolean include_both_directions)
          Return an array of the indices in this GraphPerspective of all edges between the two nodes given, this will result in three types of edges: Undirected Edges Directed Edges from the Source Node to the Target Node Directed Edges from the Target Node to the Source Node Depending on the parameters passed, this can be coonfigured.
 int[] getEdgeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-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-acyclic-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 in this GraphPerspective.
 int getEdgeTargetIndex(int edge_index)
          Retrieve the index of the Node that is the target of the Edge with the given index in this GraphPerspective.
 int getInDegree(int node_index)
          Return the number of Edges e in this GraphPerspective such that e.getTarget().equals( node ).
 int getInDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getInDegree(Node node)
          Return the number of Edges e in this GraphPerspective such that e.getTarget().equals( node ).
 int getInDegree(Node node, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getIndex(Edge edge)
          Return the index of the given Edge in this GraphPerspective.
 int getIndex(Node node)
          Return the index of the given Node in this GraphPerspective.
 Node getNode(int index)
          Return the Node with the given index in this GraphPerspective.
 int getNodeCount()
          Returns number of active nodes in this perspective.
 int getNodeIndex(int root_graph_node_index)
          Return the index in this GraphPerspective of the Node with the given index in the RootGraph.
 int[] getNodeIndicesArray()
          Return an array containing the indices in the RootGraph of all Nodes in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
 int[] getNodeMetaChildIndicesArray(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-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-acyclic-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 e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(int node_index, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(Node node)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 int getOutDegree(Node node, boolean count_undirected_edges)
          Return the number of Edges e in this GraphPerspective such that e.getSource().equals( node ).
 RootGraph getRootGraph()
          Return the root Graph for this GraphPerspective
 int getRootGraphEdgeIndex(int perspective_edge_index)
          Return the index in the RootGraph of the Edge with the given index in this GraphPerspective.
 int getRootGraphNodeIndex(int perspective_node_index)
          Return the index in the RootGraph of the Node with the given index in this GraphPerspective.
 Edge hideEdge(Edge edge)
          If this GraphPerspective does not hide the given Edge, change it so that it does hide the edge.
 int hideEdge(int edge_index)
          If this GraphPerspective does not hide the Edge with the given index in this GraphPerspective, change it so that it does hide the edge.
 int[] hideEdges(int[] edge_indices)
          If this GraphPerspective does not hide any of the Edges corresponding to the indices in the given array, change it so that it does hide those edges.
 java.util.List hideEdges(java.util.List edges)
          If this GraphPerspective does not hide any of the Edges in the given List, change it so that it does hide those edges.
 int hideNode(int node_index)
          If this GraphPerspective does not hide the Node with the given index in this GraphPerspective, change it so that it does hide the node and all of its incident edges.
 Node hideNode(Node node)
          If this GraphPerspective does not hide the given Node, change it so that it does hide the node and all of its incident edges.
 int[] hideNodes(int[] node_indices)
          If this GraphPerspective does not hide any of the Nodes corresponding to the indices in the given array, change it so that it does hide those nodes and all Edges incident on them.
 java.util.List hideNodes(java.util.List nodes)
          If this GraphPerspective does not hide any of the Nodes in the given List, change it so that it does hide those nodes and all Edges incident on them.
 boolean isEdgeDirected(int edge_index)
          Retrieve the directedness of the Edge with the given index in this GraphPerspective.
 boolean isEdgeMetaChild(int parent_index, int child_edge_index)
          Nodes and Edges comprise an additional directed-acyclic-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-acyclic-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-acyclic-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-acyclic-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-acyclic-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-acyclic-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)
          Determine if there are any Edges in this GraphPerspective between the two Nodes with the given indices.
 boolean isNeighbor(Node a_node, Node another_node)
          Determine if there are any Edges in this GraphPerspective between the two given Nodes.
 boolean isNodeMetaChild(int parent_index, int child_node_index)
          Nodes and Edges comprise an additional directed-acyclic-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-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 GraphPerspective join(GraphPerspective peer)
          Creates a union GraphPerspective.
 java.util.List metaParentsList(Edge edge)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List metaParentsList(Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 int[] neighborsArray(int node_index)
           
 java.util.List neighborsList(Node node)
          Return a new List of the neighbors of the given Node.
 java.util.List nodeMetaChildrenList(int parent_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List nodeMetaChildrenList(Node node)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.List nodeMetaParentsList(int node_index)
          Nodes and Edges comprise an additional directed-acyclic-graph through the contains-a relationship, in which a MetaParent Node contains each of its MetaChild Nodes and Edges.
 java.util.Iterator nodesIterator()
           
 java.util.List nodesList()
           
 Edge restoreEdge(Edge edge)
          If this GraphPerspective hides the given Edge, change it so that it does not hide the edge or the Nodes on which the edge is incident.
 int restoreEdge(int edge_index)
          If this GraphPerspective hides the Edge with the given index in this GraphPerspective, change it so that it does not hide the edge or the Nodes on which the edge is incident.
 int[] restoreEdges(int[] edge_indices)
          If this GraphPerspective hides any of the Edges corresponding to the indices in the given array, change it so that it does not hide those edges or any of the Nodes on which they are incident.
 java.util.List restoreEdges(java.util.List edges)
          If this GraphPerspective hides any of the Edges in the given List, change it so that it does not hide those edges and all Nodes on which they are incident.
 int restoreNode(int node_index)
          If this GraphPerspective hides the Node with the given index in this GraphPerspective, change it so that it does not hide the node.
 Node restoreNode(Node node)
          If this GraphPerspective hides the given Node, change it so that it does not hide the node.
 int[] restoreNodes(int[] node_indices)
          If this GraphPerspective hides any of the Nodes corresponding to the indices in the given array, change it so that it does not hide those nodes.
 java.util.List restoreNodes(java.util.List nodes)
          If this GraphPerspective hides any of the Nodes in the given List, change it so that it does not hide those nodes and all Edges incident on them.
 

Method Detail

clone

public java.lang.Object clone()
Create a new ColtGraphPerspective with the same RootGraph and a new copy of the rootNodeIndexToPerspectiveNodeIndexMap and rootEdgeIndexToPerspectiveEdgeIndexMap of this one.


getRootGraph

public RootGraph getRootGraph()
Return the root Graph for this GraphPerspective


getNodeCount

public int getNodeCount()
Returns number of active nodes in this perspective.


getEdgeCount

public int getEdgeCount()
Returns number of active edges in this perspective.


nodesIterator

public java.util.Iterator nodesIterator()

nodesList

public java.util.List nodesList()

getNodeIndicesArray

public int[] getNodeIndicesArray()
Return an array containing the indices in the RootGraph of all Nodes in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
The result should be considered final; it must not be modified by the receiver.


edgesIterator

public java.util.Iterator edgesIterator()

edgesList

public java.util.List edgesList()

getEdgeIndicesArray

public int[] getEdgeIndicesArray()
Return an array containing the indices in the RootGraph of all Edges in this GraphPerspective, with each index in the array corresponding to the index in this GraphPerspective; the first cell's value will always be 0.
The result should be considered final; it must not be modified by the receiver.


getEdgeIndicesArray

public int[] getEdgeIndicesArray(int from_node_index,
                                 int to_node_index,
                                 boolean include_undirected_edges,
                                 boolean include_both_directions)
Return an array of the indices in this GraphPerspective of all edges between the two nodes given, this will result in three types of edges:
  1. Undirected Edges
  2. Directed Edges from the Source Node to the Target Node
  3. Directed Edges from the Target Node to the Source Node
  4. Depending on the parameters passed, this can be coonfigured.


hideNode

public Node hideNode(Node node)
If this GraphPerspective does not hide the given Node, change it so that it does hide the node and all of its incident edges. If the given Node is not already hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) and then returns the given Node after firing the event.


hideNode

public int hideNode(int node_index)
If this GraphPerspective does not hide the Node with the given index in this GraphPerspective, change it so that it does hide the node and all of its incident edges. If the Node is not already hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( int[], int[][], ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


hideNodes

public java.util.List hideNodes(java.util.List nodes)
If this GraphPerspective does not hide any of the Nodes in the given List, change it so that it does hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) with those of the given nodes that are not already hidden, and then returns them in a List after firing the event.


hideNodes

public int[] hideNodes(int[] node_indices)
If this GraphPerspective does not hide any of the Nodes corresponding to the indices in the given array, change it so that it does hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #hideAllIncidentEdges( Node[], Edge[][], ChangeEvent ) with those nodes that are not already hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the node with that index was already hidden.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


restoreNode

public Node restoreNode(Node node)
If this GraphPerspective hides the given Node, change it so that it does not hide the node. If the given Node is presently hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given Node after firing the event.


restoreNode

public int restoreNode(int node_index)
If this GraphPerspective hides the Node with the given index in this GraphPerspective, change it so that it does not hide the node. If the Node is presently hidden, this calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


restoreNodes

public java.util.List restoreNodes(java.util.List nodes)
If this GraphPerspective hides any of the Nodes in the given List, change it so that it does not hide those nodes and all Edges incident on them. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those of the given nodes that are not already hidden, and then returns them in a List after firing the event.


restoreNodes

public int[] restoreNodes(int[] node_indices)
If this GraphPerspective hides any of the Nodes corresponding to the indices in the given array, change it so that it does not hide those nodes. This calls #setRootNodeIndexToPerspectiveNodeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those nodes that are presently hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the node with that index was already restored.
This method is implemented to operate without accessing any Node or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


hideEdge

public Edge hideEdge(Edge edge)
If this GraphPerspective does not hide the given Edge, change it so that it does hide the edge. If the given Edge is not already hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given Edge after firing the event.


hideEdge

public int hideEdge(int edge_index)
If this GraphPerspective does not hide the Edge with the given index in this GraphPerspective, change it so that it does hide the edge. If the Edge is not already hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Edge or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


hideEdges

public java.util.List hideEdges(java.util.List edges)
If this GraphPerspective does not hide any of the Edges in the given List, change it so that it does hide those edges. This calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those of the given edges that are not already hidden, and then returns them in a List after firing the event.


hideEdges

public int[] hideEdges(int[] edge_indices)
If this GraphPerspective does not hide any of the Edges corresponding to the indices in the given array, change it so that it does hide those edges. This calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) with those edges that are not already hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the edge with that index was already hidden.
This method is implemented to operate without accessing any Edge or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


restoreEdge

public Edge restoreEdge(Edge edge)
If this GraphPerspective hides the given Edge, change it so that it does not hide the edge or the Nodes on which the edge is incident. If the given Edge is presently hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #restoreAllIncidentNodes( Edge[], Node[][], ChangeEvent ) and then returns the given Edge after firing the event.


restoreEdge

public int restoreEdge(int edge_index)
If this GraphPerspective hides the Edge with the given index in this GraphPerspective, change it so that it does not hide the edge or the Nodes on which the edge is incident. If the Edge is presently hidden, this calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #restoreAllIncidentNodes( int[], int[][], ChangeEvent ) and then returns the given index after firing the event.
This method is implemented to operate without accessing any Edge or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


restoreEdges

public java.util.List restoreEdges(java.util.List edges)
If this GraphPerspective hides any of the Edges in the given List, change it so that it does not hide those edges and all Nodes on which they are incident. This calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #restoreAllIncidentNodes( Edge[], Node[][], ChangeEvent ) with those of the given edges that are not already hidden, and then returns them in a List after firing the event.


restoreEdges

public int[] restoreEdges(int[] edge_indices)
If this GraphPerspective hides any of the Edges corresponding to the indices in the given array, change it so that it does not hide those edges or any of the Nodes on which they are incident. This calls #setRootEdgeIndexToPerspectiveEdgeIndexMap( OpenIntIntHashMap, boolean, ChangeEvent ) and #restoreAllIncidentNodes( int[], int[][], ChangeEvent ) with those edges that are presently hidden, and then, after firing the event, returns an array of equal length to the one given, in which each corresponding position is either the same as in the argument array or is 0, indicating that the edge with that index was already restored.
This method is implemented to operate without accessing any Edge or Edge objects, and is thus likely to offer the greater efficiency compared to its non-index counterpart in highly optimized environments.


containsNode

public boolean containsNode(Node node)
Return true if the given Node is in this GraphPerspective. False otherwise. This method is recursive, so even if this GraphPerspective does hide the Node, this method will return true if the given Node is contained within any non-hidden Node (via the MetaParent->MetaChild relationship) at any depth. This method calls containsNode( Node, boolean ) 55 with a true recurse boolean argument.


containsNode

public boolean containsNode(Node node,
                            boolean recurse)
Return true if the given Node is in this GraphPerspective. False otherwise. If the recurse flag is true then this method will be recursive, so even if this GraphPerspective does hide the Node, this method will return true if the given Node is contained within any non-hidden Node (via the MetaParent->MetaChild relationship) at any depth. If recurse is false then this method will return false iff the given Node is hidden in this GraphPerspective.


containsEdge

public boolean containsEdge(Edge edge)
Return true if the given Edge is in this GraphPerspective. False otherwise. This method is recursive, so even if this GraphPerspective does hide the Edge, this method will return true if the given Edge is contained within any non-hidden Node (via the MetaParent->MetaChild relationship) at any depth. This method calls containsEdge( Edge, boolean ) 55 with a true recurse boolean argument.


containsEdge

public boolean containsEdge(Edge edge,
                            boolean recurse)
Return true if the given Edge is in this GraphPerspective. False otherwise. If the recurse flag is true then this method will be recursive, so even if this GraphPerspective does hide the Edge, this method will return true if the given Edge is contained within any non-hidden Node (via the MetaParent->MetaChild relationship) at any depth. If recurse is false then this method will return false iff the given Edge is hidden in this GraphPerspective.


join

public GraphPerspective join(GraphPerspective peer)
Creates a union GraphPerspective. The given GraphPerspective must have the same rootGraph as this one.


createGraphPerspective

public 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). This implementation simply delegates to the rootGraph.


createGraphPerspective

public GraphPerspective createGraphPerspective(int[] node_indices,
                                               int[] edge_indices)
Create a new GraphPerspective with just the Nodes with the given node_indices and just the Edges with the given edge_indices (and all Nodes incident on the given Edges). Each index may be an index in either the RootGraph or this GraphPerspective. This implementation simply delegates to the rootGraph after converting all indices to RootGraph indices.


createGraphPerspective

public GraphPerspective createGraphPerspective(giny.filter.Filter filter)
Create a new GraphPerspective with all of the Nodes from this one that pass the given filter and all of the Edges from this one that pass the filter (and all Nodes incident on those edges). This implementation creates a filtered array of Nodes and another of Edges and then calls createGraphPerspective( Node[], Edge[] ) 55 .


neighborsList

public java.util.List neighborsList(Node node)
Return a new List of the neighbors of the given Node. If the Node is not in this perspective, return null. The returned List will include only those Nodes in this perspective that are the target or source of Edges in this perspective. If there are any self-edges, Node will be included in the result.


neighborsArray

public int[] neighborsArray(int node_index)

isNeighbor

public boolean isNeighbor(Node a_node,
                          Node another_node)
Determine if there are any Edges in this GraphPerspective between the two given Nodes.


isNeighbor

public boolean isNeighbor(int a_node_index,
                          int another_node_index)
Determine if there are any Edges in this GraphPerspective between the two Nodes with the given indices.


edgeExists

public boolean edgeExists(Node from,
                          Node to)
Determine if there are any Edges in this GraphPerspective from the first given Node to the second. If either Node is not in this perspective, the result will be false.


edgeExists

public boolean edgeExists(int from_node_index,
                          int to_node_index)
Determine if there are any Edges in this GraphPerspective from the Node with the first of the given indices to the Node with the second of the given indices.


getEdgeCount

public int getEdgeCount(Node from,
                        Node to,
                        boolean count_undirected_edges)
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.


getEdgeCount

public int getEdgeCount(int from_node_index,
                        int to_node_index,
                        boolean count_undirected_edges)
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.


edgesList

public java.util.List edgesList(Node from,
                                Node to)
Return a new List of the Edges in this GraphPerspective from the first given Node to the second given Node.


edgesList

public java.util.List edgesList(int from_node_index,
                                int to_node_index,
                                boolean include_undirected_edges)
Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.


getEdgeIndicesArray

public int[] getEdgeIndicesArray(int from_node_index,
                                 int to_node_index,
                                 boolean include_undirected_edges)
Return an array of the indices in this GraphPerspective of all Edges from the Node with the first given index to the Node with the second given index.
The result should be considered final; it must not be modified by the receiver.


getInDegree

public int getInDegree(Node node)
Return the number of Edges e in this GraphPerspective 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 ).


getInDegree

public int getInDegree(int node_index)
Return the number of Edges e in this GraphPerspective 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 ).


getInDegree

public int getInDegree(Node node,
                       boolean count_undirected_edges)
Return the number of Edges e in this GraphPerspective 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 ).


getInDegree

public int getInDegree(int node_index,
                       boolean count_undirected_edges)
Return the number of Edges e in this GraphPerspective 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 ).


getOutDegree

public int getOutDegree(Node node)
Return the number of Edges e in this GraphPerspective 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 ).


getOutDegree

public int getOutDegree(int node_index)
Return the number of Edges e in this GraphPerspective 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 ).


getOutDegree

public int getOutDegree(Node node,
                        boolean count_undirected_edges)
Return the number of Edges e in this GraphPerspective 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 ).


getOutDegree

public int getOutDegree(int node_index,
                        boolean count_undirected_edges)
Return the number of Edges e in this GraphPerspective 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 ).


getDegree

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


getDegree

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


getIndex

public int getIndex(Node node)
Return the index of the given Node in this GraphPerspective. If the Node is hidden in this perspective, the result will be 0. Otherwise each Node in this perspective is guaranteed to have a unique index in the range 1 to getNodeCount(), inclusive. Note that if the GraphPerspective changes in any way then Nodes' indices may change and this method must be called again to determine the index of the given Node.


getNodeIndex

public int getNodeIndex(int root_graph_node_index)
Return the index in this GraphPerspective of the Node with the given index in the RootGraph. If the Node with the given index is hidden in this perspective, the result will be 0. Otherwise each Node in this perspective is guaranteed to have a unique index in the range 1 to getNodeCount(), inclusive. Note that if the GraphPerspective changes in any way then Nodes' indices may change and this method must be called again.


getRootGraphNodeIndex

public int getRootGraphNodeIndex(int perspective_node_index)
Return the index in the RootGraph of the Node with the given index in this GraphPerspective.


getNode

public Node getNode(int index)
Return the Node with the given index in this GraphPerspective. Each index in this perspective in the range 1 to getNodeCount(), inclusive, is guaranteed to correspond to a unique Node. Note that if the GraphPerspective changes in any way then Nodes' indices may change and this method must be called again to determine the present Node at the given index.


getIndex

public int getIndex(Edge edge)
Return the index of the given Edge in this GraphPerspective. If the Edge is hidden in this perspective, the result will be 0. Otherwise each Edge in this perspective is guaranteed to have a unique index in the range 1 to getEdgeCount(), inclusive. Note that if the GraphPerspective changes in any way then Edges' indices may change and this method must be called again to determine the index of the given Edge.


getEdgeIndex

public int getEdgeIndex(int root_graph_edge_index)
Return the index in this GraphPerspective of the Edge with the given index in the RootGraph. If the Edge with the given index is hidden in this perspective, the result will be 0. Otherwise each Edge in this perspective is guaranteed to have a unique index in the range 1 to getEdgeCount(), inclusive. Note that if the GraphPerspective changes in any way then Edges' indices may change and this method must be called again.


getRootGraphEdgeIndex

public int getRootGraphEdgeIndex(int perspective_edge_index)
Return the index in the RootGraph of the Edge with the given index in this GraphPerspective.


getEdge

public Edge getEdge(int index)
Return the Edge with the given index in this GraphPerspective. Each index in this perspective in the range 1 to getEdgeCount(), inclusive, is guaranteed to correspond to a unique Edge. Note that if the GraphPerspective changes in any way then Edges' indices may change and this method must be called again to determine the present Edge at the given index.


getEdgeSourceIndex

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


getEdgeTargetIndex

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


isEdgeDirected

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


isMetaParent

public boolean isMetaParent(Node child,
                            Node parent)
Nodes and Edges comprise an additional directed-acyclic-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). Calls isNodeMetaParent( int, int ) 55 .
Note the inverse relationship between this method and isMetaChild( Node, Node ) 55 : isMetaChild( parent, child ) == isMetaParent( child, parent ).


isNodeMetaParent

public boolean isNodeMetaParent(int child_node_index,
                                int parent_index)
Nodes and Edges comprise an additional directed-acyclic-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).
Note the inverse relationship between this method and isNodeMetaChild( int, int ) 55 : isNodeMetaChild( parent_index, child_index ) == isNodeMetaParent( child_index, parent_index ).


metaParentsList

public java.util.List metaParentsList(Node node)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the given Node. If there are no MetaParents then the result will be null. Calls nodeMetaParentsList( int ) 55 .


nodeMetaParentsList

public java.util.List nodeMetaParentsList(int node_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node in this GraphPerspective with the given index. If there are no MetaParents then the result will be null.


getNodeMetaParentIndicesArray

public int[] getNodeMetaParentIndicesArray(int node_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node with the given index. If there are no MetaParents then the result will be null.
The result should be considered final; it must not be modified by the receiver.


isMetaChild

public boolean isMetaChild(Node parent,
                           Node child)
Nodes and Edges comprise an additional directed-acyclic-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). Calls isNodeMetaChild( int, int ) 55 .
Note the inverse relationship between this method and isMetaParent( Node, Node ) 55 : isMetaChild( parent, child ) == isMetaParent( child, parent ).


isNodeMetaChild

public boolean isNodeMetaChild(int parent_index,
                               int child_node_index)
Nodes and Edges comprise an additional directed-acyclic-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) in this GraphPerspective.
Note the inverse relationship between this method and isNodeMetaParent( int, int ) 55 : isNodeMetaChild( parent_index, child_index ) == isNodeMetaParent( child_index, parent_index ).


nodeMetaChildrenList

public java.util.List nodeMetaChildrenList(Node node)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the given Node. If there are no MetaChildren then the result will be null. Calls nodeMetaChildrenList( int ) 55 .


nodeMetaChildrenList

public java.util.List nodeMetaChildrenList(int parent_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node in this GraphPerspective with the given index. If there are no MetaChildren then the result will be null.


getNodeMetaChildIndicesArray

public int[] getNodeMetaChildIndicesArray(int node_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node with the given index. If there are no MetaChildren then the result will be null.
The result should be considered final; it must not be modified by the receiver.


isMetaParent

public boolean isMetaParent(Edge child,
                            Node parent)
Nodes and Edges comprise an additional directed-acyclic-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). Calls isEdgeMetaParent( int, int ) 55 .
Note the inverse relationship between this method and isMetaChild( Node, Edge ) 55 : isMetaChild( parent, child ) == isMetaParent( child, parent ).


isEdgeMetaParent

public boolean isEdgeMetaParent(int child_edge_index,
                                int parent_index)
Nodes and Edges comprise an additional directed-acyclic-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).
Note the inverse relationship between this method and isEdgeMetaChild( int, int ) 55 : isEdgeMetaChild( parent_index, child_index ) == isEdgeMetaParent( child_index, parent_index ).


metaParentsList

public java.util.List metaParentsList(Edge edge)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the given Edge. If there are no MetaParents then the result will be null. Calls edgeMetaParentsList( int ) 55 .


edgeMetaParentsList

public java.util.List edgeMetaParentsList(int edge_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Edge in this GraphPerspective with the given index. If there are no MetaParents then the result will be null.


getEdgeMetaParentIndicesArray

public int[] getEdgeMetaParentIndicesArray(int edge_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Edge with the given index. If there are no MetaParents then the result will be null.
The result should be considered final; it must not be modified by the receiver.


isMetaChild

public boolean isMetaChild(Node parent,
                           Edge child)
Nodes and Edges comprise an additional directed-acyclic-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). Calls isEdgeMetaChild( int, int ) 55 .
Note the inverse relationship between this method and isMetaParent( Edge, Node ) 55 : isMetaChild( parent, child ) == isMetaParent( child, parent ).


isEdgeMetaChild

public boolean isEdgeMetaChild(int parent_index,
                               int child_edge_index)
Nodes and Edges comprise an additional directed-acyclic-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) in this GraphPerspective.
Note the inverse relationship between this method and isEdgeMetaParent( int, int ) 55 : isEdgeMetaChild( parent_index, child_index ) == isEdgeMetaParent( child_index, parent_index ).


edgeMetaChildrenList

public java.util.List edgeMetaChildrenList(Node node)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the given Node. If there are no Edge MetaChildren then the result will be null. Calls edgeMetaChildrenList( int ) 55 .


edgeMetaChildrenList

public java.util.List edgeMetaChildrenList(int node_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node in this GraphPerspective with the given index. If there are no Edge MetaChildren then the result will be null.


getEdgeMetaChildIndicesArray

public int[] getEdgeMetaChildIndicesArray(int node_index)
Nodes and Edges comprise an additional directed-acyclic-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 (in this GraphPerspective) of the Node with the given index. If there are no MetaChildren then the result will be null.
The result should be considered final; it must not be modified by the receiver.


getAdjacentEdgesList

public java.util.List getAdjacentEdgesList(Node node,
                                           boolean include_undirected_edges,
                                           boolean include_both_directions)
Returns all Adjacent Edges to the given node.


getAdjacentEdgeIndicesArray

public int[] getAdjacentEdgeIndicesArray(int node_index,
                                         boolean include_undirected_edges,
                                         boolean include_both_directions)
Returns all Adjacent Edges to the given node.


getConnectingEdges

public java.util.List getConnectingEdges(java.util.List nodes)
This will return an array of edge indices that are the edges between nodes


getConnectingEdgeIndicesArray

public int[] getConnectingEdgeIndicesArray(int[] node_indices)
This will return an array of edge indices that are the edges between nodes


createGraphPerspective

public GraphPerspective createGraphPerspective(int[] node_indices)
Create a GraphPerspective given a list of nodes. This method will automatically find all the interconnected edges.