soot.toolkits.graph
Interface MutableDirectedGraph
- All Known Implementing Classes:
- HashMutableDirectedGraph
- public interface MutableDirectedGraph
- extends DirectedGraph
Defines a DirectedGraph which is modifiable. Provides
an interface to add/delete nodes and edges.
Method Summary |
void |
addEdge(java.lang.Object from,
java.lang.Object to)
Adds an edge to the graph between 2 nodes. |
void |
addNode(java.lang.Object node)
Adds a node to the graph. |
boolean |
containsEdge(java.lang.Object from,
java.lang.Object to)
|
boolean |
containsNode(java.lang.Object node)
|
java.util.List |
getNodes()
|
void |
removeEdge(java.lang.Object from,
java.lang.Object to)
Removes an edge between 2 nodes in the graph. |
void |
removeNode(java.lang.Object node)
Removes a node from the graph. |
addEdge
public void addEdge(java.lang.Object from,
java.lang.Object 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
public void removeEdge(java.lang.Object from,
java.lang.Object 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
public boolean containsEdge(java.lang.Object from,
java.lang.Object to)
- Returns:
- true if the graph contains an edge the 2 nodes
false otherwise.
getNodes
public java.util.List getNodes()
- Returns:
- a list of the nodes that compose the graph. No ordering is implied.
addNode
public void addNode(java.lang.Object 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
public void removeNode(java.lang.Object 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
public boolean containsNode(java.lang.Object node)
- Parameters:
node
- node that we want to know if the graph constains.- Returns:
- true if the graph contains the node.
false otherwise.