soot.toolkits.graph
Interface MutableDirectedGraph<N>

All Superinterfaces:
DirectedGraph<N>, Iterable<N>
All Known Subinterfaces:
ReversibleGraph
All Known Implementing Classes:
HashMutableDirectedGraph, HashReversibleGraph, MemoryEfficientGraph

public interface MutableDirectedGraph<N>
extends DirectedGraph<N>

Defines a DirectedGraph which is modifiable. Provides an interface to add/delete nodes and edges.


Method Summary
 void addEdge(N from, N to)
          Adds an edge to the graph between 2 nodes.
 void addNode(N node)
          Adds a node to the graph.
 boolean containsEdge(N from, N to)
           
 boolean containsNode(N node)
           
 List<N> getNodes()
           
 void removeEdge(N from, N to)
          Removes an edge between 2 nodes in the graph.
 void removeNode(N node)
          Removes a node from the graph.
 
Methods inherited from interface soot.toolkits.graph.DirectedGraph
getHeads, getPredsOf, getSuccsOf, getTails, iterator, size
 

Method Detail

addEdge

void addEdge(N from,
             N to)
Adds an edge to the graph between 2 nodes. If the edge is already present no change is made.

Parameters:
from - out node for the edge.
to - in node for the edge.

removeEdge

void removeEdge(N from,
                N to)
Removes an edge between 2 nodes in the graph. If the edge is not present no change is made.

Parameters:
from - out node for the edge to remove.
to - in node for the edge to remove.

containsEdge

boolean containsEdge(N from,
                     N to)
Returns:
true if the graph contains an edge the 2 nodes false otherwise.

getNodes

List<N> getNodes()
Returns:
a list of the nodes that compose the graph. No ordering is implied.

addNode

void addNode(N node)
Adds a node to the graph. Initially the added node has no successors or predecessors. ; as a consequence it is considered both a head and tail for the graph.

Parameters:
node - a node to add to the graph.
See Also:
DirectedGraph.getHeads(), DirectedGraph.getTails()

removeNode

void removeNode(N node)
Removes a node from the graph. If the node is not found in the graph, no change is made.

Parameters:
node - the node to be removed.

containsNode

boolean containsNode(N node)
Parameters:
node - node that we want to know if the graph constains.
Returns:
true if the graph contains the node. false otherwise.