soot.jimple.toolkits.invoke
Class MethodCallGraph

java.lang.Object
  |
  +--soot.toolkits.graph.HashMutableDirectedGraph
        |
        +--soot.jimple.toolkits.invoke.MethodCallGraph
All Implemented Interfaces:
DirectedGraph, MutableDirectedGraph

public class MethodCallGraph
extends HashMutableDirectedGraph

A directed graph whose nodes are methods and whose edges are call edges. It also knows about default entry points, and more entry points can be added using the addEntryPoint method.


Constructor Summary
MethodCallGraph(InvokeGraph ig)
          Constructs a MethodCallGraph based on the invoke graph ig, with default entry points.
MethodCallGraph(InvokeGraph ig, java.util.Collection methods)
          Constructs a MethodCallGraph based on the invoke graph ig, with entry points contained in methods.
 
Method Summary
 void addEntryPoint(SootMethod m)
          Adds an entry point to the current set of entry points.
 void clearEntryPoints()
          Clear the current set of entry points.
 java.util.List getEntryPoints()
          Returns the current set of entry points.
 java.util.List getMethodsReachableFrom(java.util.Collection methods)
          Returns a list of methods reachable from a method listed in methods.
 java.util.List getReachableMethods()
          Returns true if the method m is reachable.
 boolean isReachable(java.lang.String signature)
          Returns true if the method specified in signature is reachable.
 void refresh()
          Recomputes the call graph, based on the entry points specified by the current set of entry points.
 void setInvokeGraph(InvokeGraph ig)
          Sets the underlying invoke graph to ig.
 
Methods inherited from class soot.toolkits.graph.HashMutableDirectedGraph
addEdge, addNode, clearAll, clone, containsEdge, containsNode, getHeads, getNodes, getPredsOf, getSuccsOf, getTails, iterator, removeEdge, removeNode, size
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodCallGraph

public MethodCallGraph(InvokeGraph ig)
Constructs a MethodCallGraph based on the invoke graph ig, with default entry points.

MethodCallGraph

public MethodCallGraph(InvokeGraph ig,
                       java.util.Collection methods)
Constructs a MethodCallGraph based on the invoke graph ig, with entry points contained in methods.
Method Detail

setInvokeGraph

public void setInvokeGraph(InvokeGraph ig)
Sets the underlying invoke graph to ig. Does not trigger recomputation or reachable methods.

refresh

public void refresh()
Recomputes the call graph, based on the entry points specified by the current set of entry points.

addEntryPoint

public void addEntryPoint(SootMethod m)
Adds an entry point to the current set of entry points.

clearEntryPoints

public void clearEntryPoints()
Clear the current set of entry points.

getEntryPoints

public java.util.List getEntryPoints()
Returns the current set of entry points.

getMethodsReachableFrom

public java.util.List getMethodsReachableFrom(java.util.Collection methods)
Returns a list of methods reachable from a method listed in methods.

isReachable

public boolean isReachable(java.lang.String signature)
Returns true if the method specified in signature is reachable.

getReachableMethods

public java.util.List getReachableMethods()
Returns true if the method m is reachable. *. public boolean isReachable(SootMethod m) { return containsNode(m); } /** Returns a list of reachable methods.