Package soot.toolkits.graph
Class MemoryEfficientGraph<N>
- java.lang.Object
-
- soot.toolkits.graph.HashMutableDirectedGraph<N>
-
- soot.toolkits.graph.MemoryEfficientGraph<N>
-
- Type Parameters:
N-
- All Implemented Interfaces:
Iterable<N>,DirectedGraph<N>,MutableDirectedGraph<N>
public class MemoryEfficientGraph<N> extends HashMutableDirectedGraph<N>
A memory efficient version of HashMutableDirectedGraph, in the sense that throw-away objects passed as arguments will not be kept in the process of adding edges.
-
-
Field Summary
-
Fields inherited from class soot.toolkits.graph.HashMutableDirectedGraph
heads, nodeToPreds, nodeToSuccs, tails
-
-
Constructor Summary
Constructors Constructor Description MemoryEfficientGraph()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEdge(N from, N to)Adds an edge to the graph between 2 nodes.voidaddNode(N o)Adds a node to the graph.voidremoveEdge(N from, N to)Removes an edge between 2 nodes in the graph.voidremoveNode(N o)Removes a node from the graph.-
Methods inherited from class soot.toolkits.graph.HashMutableDirectedGraph
clearAll, clone, containsEdge, containsNode, getHeads, getNodes, getPredsOf, getPredsOfAsSet, getSuccsOf, getSuccsOfAsSet, getTails, iterator, printGraph, size
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Method Detail
-
addNode
public void addNode(N o)
Description copied from interface:MutableDirectedGraphAdds 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.- Specified by:
addNodein interfaceMutableDirectedGraph<N>- Overrides:
addNodein classHashMutableDirectedGraph<N>- Parameters:
o- a node to add to the graph.- See Also:
DirectedGraph.getHeads(),DirectedGraph.getTails()
-
removeNode
public void removeNode(N o)
Description copied from interface:MutableDirectedGraphRemoves a node from the graph. If the node is not found in the graph, no change is made.- Specified by:
removeNodein interfaceMutableDirectedGraph<N>- Overrides:
removeNodein classHashMutableDirectedGraph<N>- Parameters:
o- the node to be removed.
-
addEdge
public void addEdge(N from, N to)
Description copied from interface:MutableDirectedGraphAdds an edge to the graph between 2 nodes. If the edge is already present no change is made.- Specified by:
addEdgein interfaceMutableDirectedGraph<N>- Overrides:
addEdgein classHashMutableDirectedGraph<N>- Parameters:
from- out node for the edge.to- in node for the edge.
-
removeEdge
public void removeEdge(N from, N to)
Description copied from interface:MutableDirectedGraphRemoves an edge between 2 nodes in the graph. If the edge is not present no change is made.- Specified by:
removeEdgein interfaceMutableDirectedGraph<N>- Overrides:
removeEdgein classHashMutableDirectedGraph<N>- Parameters:
from- out node for the edge to remove.to- in node for the edge to remove.
-
-