Class DirectedCallGraph
- java.lang.Object
-
- soot.jimple.toolkits.annotation.purity.DirectedCallGraph
-
- All Implemented Interfaces:
Iterable<SootMethod>,DirectedGraph<SootMethod>
public class DirectedCallGraph extends Object implements DirectedGraph<SootMethod>
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. Methods filtered-out by the SootMethodFilter will not appear in the DirectedGraph!
-
-
Field Summary
Fields Modifier and Type Field Description protected List<SootMethod>headsprotected Set<SootMethod>nodesprotected Map<SootMethod,List<SootMethod>>predprotected intsizeprotected Map<SootMethod,List<SootMethod>>succprotected List<SootMethod>tails
-
Constructor Summary
Constructors Constructor Description DirectedCallGraph(CallGraph cg, SootMethodFilter filter, Iterator<SootMethod> heads, boolean verbose)The constructor does all the work here.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<SootMethod>getHeads()You get a List of SootMethod.List<SootMethod>getPredsOf(SootMethod s)You get a List of SootMethod.List<SootMethod>getSuccsOf(SootMethod s)You get a List of SootMethod.List<SootMethod>getTails()You get a List of SootMethod.Iterator<SootMethod>iterator()You get an Iterator on SootMethod.intsize()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
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
nodes
protected Set<SootMethod> nodes
-
succ
protected Map<SootMethod,List<SootMethod>> succ
-
pred
protected Map<SootMethod,List<SootMethod>> pred
-
heads
protected List<SootMethod> heads
-
tails
protected List<SootMethod> tails
-
size
protected int size
-
-
Constructor Detail
-
DirectedCallGraph
public DirectedCallGraph(CallGraph cg, SootMethodFilter filter, Iterator<SootMethod> 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 fast... 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:
cg-filter-heads- is a List of SootMethodverbose-
-
-
Method Detail
-
getHeads
public List<SootMethod> getHeads()
You get a List of SootMethod.- Specified by:
getHeadsin interfaceDirectedGraph<SootMethod>- Returns:
-
getTails
public List<SootMethod> getTails()
You get a List of SootMethod.- Specified by:
getTailsin interfaceDirectedGraph<SootMethod>- Returns:
-
iterator
public Iterator<SootMethod> iterator()
You get an Iterator on SootMethod.- Specified by:
iteratorin interfaceDirectedGraph<SootMethod>- Specified by:
iteratorin interfaceIterable<SootMethod>- Returns:
-
size
public int size()
Description copied from interface:DirectedGraphReturns the node count for this graph.- Specified by:
sizein interfaceDirectedGraph<SootMethod>- Returns:
-
getSuccsOf
public List<SootMethod> getSuccsOf(SootMethod s)
You get a List of SootMethod.- Specified by:
getSuccsOfin interfaceDirectedGraph<SootMethod>- Parameters:
s-- Returns:
-
getPredsOf
public List<SootMethod> getPredsOf(SootMethod s)
You get a List of SootMethod.- Specified by:
getPredsOfin interfaceDirectedGraph<SootMethod>- Parameters:
s-- Returns:
-
-