Package soot.toolkits.graph
Interface MutableDirectedGraph<N>
-
- Type Parameters:
N-
- All Superinterfaces:
DirectedGraph<N>,Iterable<N>
- All Known Subinterfaces:
ReversibleGraph<N>
- All Known Implementing Classes:
ExtendedHashMutableDirectedGraph,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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddEdge(N from, N to)Adds an edge to the graph between 2 nodes.voidaddNode(N node)Adds a node to the graph.booleancontainsEdge(N from, N to)booleancontainsNode(N node)List<N>getNodes()voidremoveEdge(N from, N to)Removes an edge between 2 nodes in the graph.voidremoveNode(N node)Removes a node from the graph.-
Methods inherited from interface soot.toolkits.graph.DirectedGraph
getHeads, getPredsOf, getSuccsOf, getTails, iterator, size
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
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.
-
-