soot.jimple.toolkits.annotation.purity
Class DirectedCallGraph

java.lang.Object
  extended by soot.jimple.toolkits.annotation.purity.DirectedCallGraph
All Implemented Interfaces:
Iterable, DirectedGraph

public class DirectedCallGraph
extends Object
implements DirectedGraph

Builds a DirectedGraph from a CallGraph and SootMethodFilter. This is used in AbstractInterproceduralAnalysis to construct a reverse pseudo topological order on which to iterate. You can specify a SootMethodFilter to trim the graph by cutting call edges strarting Methods filtered-out by the SootMethodFilter will not appear in the DirectedGraph!


Field Summary
protected  List heads
           
protected  Set nodes
           
protected  Map<Object,List> pred
           
protected  int size
           
protected  Map<Object,List> succ
           
protected  List tails
           
 
Constructor Summary
DirectedCallGraph(CallGraph cg, SootMethodFilter filter, Iterator heads, boolean verbose)
          The constructor does all the work here.
 
Method Summary
 List getHeads()
          You get a List of SootMethod.
 List getPredsOf(Object s)
          You get a List of SootMethod.
 List getSuccsOf(Object s)
          You get a List of SootMethod.
 List getTails()
          You get a List of SootMethod.
 Iterator iterator()
          You get an Iterator on SootMethod.
 int size()
          Returns the node count for this graph.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

protected Set nodes

succ

protected Map<Object,List> succ

pred

protected Map<Object,List> pred

heads

protected List heads

tails

protected List tails

size

protected int size
Constructor Detail

DirectedCallGraph

public DirectedCallGraph(CallGraph cg,
                         SootMethodFilter filter,
                         Iterator heads,
                         boolean verbose)
The constructor does all the work here. After constructed, you can safely use all interface methods. Moreover, these methods should perform very fastly... The DirectedGraph will only contain methods in call paths from a method in head and comprising only methods wanted by filter. Moreover, only concrete methods are put in the graph...

Parameters:
heads - is a List of SootMethod
Method Detail

getHeads

public List getHeads()
You get a List of SootMethod.

Specified by:
getHeads in interface DirectedGraph

getTails

public List getTails()
You get a List of SootMethod.

Specified by:
getTails in interface DirectedGraph

iterator

public Iterator iterator()
You get an Iterator on SootMethod.

Specified by:
iterator in interface Iterable
Specified by:
iterator in interface DirectedGraph

size

public int size()
Description copied from interface: DirectedGraph
Returns the node count for this graph.

Specified by:
size in interface DirectedGraph

getSuccsOf

public List getSuccsOf(Object s)
You get a List of SootMethod.

Specified by:
getSuccsOf in interface DirectedGraph

getPredsOf

public List getPredsOf(Object s)
You get a List of SootMethod.

Specified by:
getPredsOf in interface DirectedGraph