soot.toolkits.graph
Class MemoryEfficientGraph

java.lang.Object
  extended by soot.toolkits.graph.HashMutableDirectedGraph
      extended by soot.toolkits.graph.MemoryEfficientGraph
All Implemented Interfaces:
Iterable, DirectedGraph, MutableDirectedGraph

public class MemoryEfficientGraph
extends HashMutableDirectedGraph

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
MemoryEfficientGraph()
           
 
Method Summary
 void addEdge(Object from, Object to)
          Adds an edge to the graph between 2 nodes.
 void addNode(Object o)
          Adds a node to the graph.
 void removeEdge(Object from, Object to)
          Removes an edge between 2 nodes in the graph.
 void removeNode(Object 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
 

Constructor Detail

MemoryEfficientGraph

public MemoryEfficientGraph()
Method Detail

addNode

public void addNode(Object o)
Description copied from interface: MutableDirectedGraph
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.

Specified by:
addNode in interface MutableDirectedGraph
Overrides:
addNode in class HashMutableDirectedGraph
Parameters:
o - a node to add to the graph.
See Also:
DirectedGraph.getHeads(), DirectedGraph.getTails()

removeNode

public void removeNode(Object o)
Description copied from interface: MutableDirectedGraph
Removes a node from the graph. If the node is not found in the graph, no change is made.

Specified by:
removeNode in interface MutableDirectedGraph
Overrides:
removeNode in class HashMutableDirectedGraph
Parameters:
o - the node to be removed.

addEdge

public void addEdge(Object from,
                    Object to)
Description copied from interface: MutableDirectedGraph
Adds an edge to the graph between 2 nodes. If the edge is already present no change is made.

Specified by:
addEdge in interface MutableDirectedGraph
Overrides:
addEdge in class HashMutableDirectedGraph
Parameters:
from - out node for the edge.
to - in node for the edge.

removeEdge

public void removeEdge(Object from,
                       Object to)
Description copied from interface: MutableDirectedGraph
Removes an edge between 2 nodes in the graph. If the edge is not present no change is made.

Specified by:
removeEdge in interface MutableDirectedGraph
Overrides:
removeEdge in class HashMutableDirectedGraph
Parameters:
from - out node for the edge to remove.
to - in node for the edge to remove.