public class CallGraph extends java.lang.Object implements java.lang.Iterable<Edge>
Modifier and Type | Field and Description |
---|---|
protected Edge |
dummy |
protected java.util.Set<Edge> |
edges |
protected QueueReader<Edge> |
reader |
protected java.util.Map<MethodOrMethodContext,Edge> |
srcMethodToEdge |
protected java.util.Map<Unit,Edge> |
srcUnitToEdge |
protected ChunkedQueue<Edge> |
stream |
protected java.util.Map<MethodOrMethodContext,Edge> |
tgtToEdge |
Constructor and Description |
---|
CallGraph() |
Modifier and Type | Method and Description |
---|---|
boolean |
addEdge(Edge e)
Used to add an edge to the call graph.
|
java.util.Iterator<Edge> |
edgesInto(MethodOrMethodContext m)
Returns an iterator over all edges that have m as their target method.
|
java.util.Iterator<Edge> |
edgesOutOf(MethodOrMethodContext m)
Returns an iterator over all edges that have m as their source method.
|
java.util.Iterator<Edge> |
edgesOutOf(Unit u)
Returns an iterator over all edges that have u as their source unit.
|
Edge |
findEdge(Unit u,
SootMethod callee)
Find the specific call edge that is going out from the callsite u and the
call target is callee.
|
boolean |
isEntryMethod(SootMethod method)
Does this method have no incoming edge?
|
java.util.Iterator<Edge> |
iterator() |
QueueReader<Edge> |
listener()
Returns a QueueReader object containing all edges added so far, and which
will be informed of any new edges that are later added to the graph.
|
QueueReader<Edge> |
newListener()
Returns a QueueReader object which will contain ONLY NEW edges which will be
added to the graph.
|
boolean |
removeAllEdgesOutOf(Unit u)
Removes all outgoing edges that start at the given unit
|
boolean |
removeEdge(Edge e)
Removes the edge e from the call graph.
|
int |
size()
Returns the number of edges in the call graph.
|
java.util.Iterator<MethodOrMethodContext> |
sourceMethods()
Returns an iterator over all methods that are the sources of at least one
edge.
|
boolean |
swapEdgesOutOf(Stmt out,
Stmt in)
Swaps an invocation statement.
|
java.lang.String |
toString() |
protected java.util.Set<Edge> edges
protected ChunkedQueue<Edge> stream
protected QueueReader<Edge> reader
protected java.util.Map<MethodOrMethodContext,Edge> srcMethodToEdge
protected java.util.Map<MethodOrMethodContext,Edge> tgtToEdge
protected Edge dummy
public boolean addEdge(Edge e)
public boolean removeAllEdgesOutOf(Unit u)
u
- The unit from which to remove all outgoing edgespublic boolean swapEdgesOutOf(Stmt out, Stmt in)
out
- The old statementin
- The new statementpublic boolean removeEdge(Edge e)
public boolean isEntryMethod(SootMethod method)
method
- public Edge findEdge(Unit u, SootMethod callee)
u
- callee
- public java.util.Iterator<MethodOrMethodContext> sourceMethods()
public java.util.Iterator<Edge> edgesOutOf(Unit u)
public java.util.Iterator<Edge> edgesOutOf(MethodOrMethodContext m)
public java.util.Iterator<Edge> edgesInto(MethodOrMethodContext m)
public QueueReader<Edge> listener()
public QueueReader<Edge> newListener()
public java.lang.String toString()
toString
in class java.lang.Object
public int size()