edu.byu.ece.graph
Interface DirectedGraph

All Superinterfaces:
java.io.Serializable
All Known Subinterfaces:
DepthFirstTree, GraphForest, HierarchicalGraph
All Known Implementing Classes:
AbstractEdifGraph, AbstractGraph, BasicDepthFirstSearchTree, BasicGraph, DepthFirstSearchForest, EdifCellInstanceCollectionGraph, EdifCellInstanceGraph, EdifOutputPortRefGraph, SCCDepthFirstSearch

public interface DirectedGraph
extends java.io.Serializable

Specifies a directed graph data structure.

TODO:


Method Summary
 boolean containsNode(java.lang.Object node)
          Determines if the given object is contained as a node within the graph.
 java.util.Collection getAncestors(java.lang.Object node)
          Return a Collection of node objects in the graph that are ancestors of the node passed in as a parameter.
 java.util.Collection getDescendents(java.lang.Object node)
          Return a Collection of node objects in the graph that are descendants of the node passed in as a parameter.
 Edge getEdge(java.lang.Object source, java.lang.Object sink)
          Return the Edge associated with the given source,sink pair.
 java.util.Collection<? extends Edge> getEdges()
          Return a Collection of all edges in the graph.
 java.util.Collection<Edge> getInputEdges(java.lang.Object node)
          Return a Collection of Edge objects that are "inputs" to the given node (i.e.
 java.util.Collection getNodes()
          Return a Collection of all nodes in the graph.
 java.util.Collection<Edge> getOutputEdges(java.lang.Object node)
          Return a Collection of Edge objects that are "outputs" to the given node (i.e.
 java.util.Collection getPredecessors(java.lang.Object node)
          Return a Collection of node objects in the graph that are direct predecessors of the node passed in as a parameter.
 DirectedGraph getSubGraph(java.util.Collection nodes)
          Return a new DirectedGraph object that is a sub-graph of this graph.
 java.util.Collection getSuccessors(java.lang.Object node)
          Return a Collection of node objects in the graph that are direct successors of the node passed in as a parameter.
 DirectedGraph invert()
           
 

Method Detail

containsNode

boolean containsNode(java.lang.Object node)
Determines if the given object is contained as a node within the graph.

Parameters:
node - Object to test for graph inclusion.
Returns:
true if the node is contained within the graph and false if the node is not contained within the graph.

getNodes

java.util.Collection getNodes()
Return a Collection of all nodes in the graph. The class type of the objects in the Collection are not specified.


getEdges

java.util.Collection<? extends Edge> getEdges()
Return a Collection of all edges in the graph. The objects in this collection are of type Edge.


getSuccessors

java.util.Collection getSuccessors(java.lang.Object node)
Return a Collection of node objects in the graph that are direct successors of the node passed in as a parameter. The Collection should be empty if there are no successors.


getPredecessors

java.util.Collection getPredecessors(java.lang.Object node)
Return a Collection of node objects in the graph that are direct predecessors of the node passed in as a parameter. The Collection should be empty if there are no predecessors.


getDescendents

java.util.Collection getDescendents(java.lang.Object node)
Return a Collection of node objects in the graph that are descendants of the node passed in as a parameter. Descendants are all nodes that are reachable from the node. The Collection should be empty if there are no Descendants.

This is the same as "reachableNodes" in ptolemy.graph.


getSubGraph

DirectedGraph getSubGraph(java.util.Collection nodes)
Return a new DirectedGraph object that is a sub-graph of this graph. The sub-graph is based on the Collection of nodes passed in as a parameter.

Parameters:
nodes -
Returns:
a new DirectedGraph object that is a sub-graph of this graph. The sub-graph is based on the Collection of nodes passed in as a parameter.

getAncestors

java.util.Collection getAncestors(java.lang.Object node)
Return a Collection of node objects in the graph that are ancestors of the node passed in as a parameter. Ancestors are all nodes that can reach the node. The Collection should be empty if there are no ancestors.

This is the same as "backwardReachableNodes" in ptolemy.graph.


getInputEdges

java.util.Collection<Edge> getInputEdges(java.lang.Object node)
Return a Collection of Edge objects that are "inputs" to the given node (i.e. edge goes into the node). The given node is considered the "sink" of the edge. This method will return an empty Collection if there are no input edges.


getOutputEdges

java.util.Collection<Edge> getOutputEdges(java.lang.Object node)
Return a Collection of Edge objects that are "outputs" to the given node (i.e. edge goes out of the node). The given node is considered the "source" of the edge. This method will return an empty Collection if there are no output edges.


getEdge

Edge getEdge(java.lang.Object source,
             java.lang.Object sink)
Return the Edge associated with the given source,sink pair. If there is no edge, return null.

TODO: What if there is more than one edge?


invert

DirectedGraph invert()