harpoon.Analysis.GraphColoring
Interface DirectedGraph

All Superinterfaces:
Graph

public interface DirectedGraph
extends Graph

DirectedGraph is an extension of the Graph interface that tracks the direction of the edges that have been added to the graph. This results in a stregthening of the specification for several of Graph's methods and the addition of two new methods, childrenOf(node) and parentsOf(node).

Version:
$Id: DirectedGraph.java,v 1.2 2002/02/25 20:57:17 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Method Summary
 boolean addEdge(Object f, Object t)
          Ensures that this graph contains an edge from f to t.
 Collection childrenOf(Object node)
          Returns a collection view for the children of a specific node.
 Collection edges()
          Returns a collection view of the edges contained in this graph.
 Collection edgesFor(Object node)
          Returns a collection view of the edges joining node to nodes in the graph.
 Collection parentsOf(Object node)
          Returns a collection view for the parents of a specific node.
 
Methods inherited from interface harpoon.Analysis.GraphColoring.Graph
addNode, getDegree, neighborsOf, nodeSet
 

Method Detail

addEdge

boolean addEdge(Object f,
                Object t)
Ensures that this graph contains an edge from f to t.
modifies: this.
effects: If this method returns normally, an edge from f to t will be in this. Returns true if this changed as a result of the call.

Specified by:
addEdge in interface Graph
Throws:
IllegalArgumentException - f or t is not present in the node set for this.
UnsupportedOperationException - addEdge is not supported by this graph.

childrenOf

Collection childrenOf(Object node)
Returns a collection view for the children of a specific node.
effects: Returns an Collection view of nodes that have an edge from node to them.
mandates: node is not removed from this while the returned Collection is in use.

Throws:
IllegalArgumentException - If node is not present in the node set for this.

parentsOf

Collection parentsOf(Object node)
Returns a collection view for the parents of a specific node.
effects: Returns a Collection view of nodes that have an edge from them to node.
mandates: node is not removed from this while the returned Collection is in use.

Throws:
IllegalArgumentException - If node is not present in the node set for this.

edges

Collection edges()
Returns a collection view of the edges contained in this graph.
effects: Returns a Collection of two-element Lists (known as pairs) where each pair corresponds to an edge { n1, n2 } in this. If the graph is modified while an iteration over the collection is in progress, the results of the iteration are undefined. Order may or may not be significant in the pairs returned.

Specified by:
edges in interface Graph

edgesFor

Collection edgesFor(Object node)
Returns a collection view of the edges joining node to nodes in the graph.
effects: Returns a Collection of two-element Lists (known as pairs) where each pair corresponds to an edge [ node, n ] or [ n, node ] in this. If the graph is modified while an iteration over the collection is in progress, the results of the iteration are undefined.

Specified by:
edgesFor in interface Graph
Throws:
IllegalArgumentException - If node is not present in the node set for this.