Package soot.jimple.toolkits.callgraph
Class ReachableMethods
- java.lang.Object
-
- soot.jimple.toolkits.callgraph.ReachableMethods
-
public class ReachableMethods extends Object
Keeps track of the methods transitively reachable from the specified entry points through the given call graph edges.- Author:
- Ondrej Lhotak
-
-
Field Summary
Fields Modifier and Type Field Description protected QueueReader<MethodOrMethodContext>allReachablesprotected CallGraphcgprotected Iterator<Edge>edgeSourceprotected Filterfilterprotected ChunkedQueue<MethodOrMethodContext>reachablesprotected Set<MethodOrMethodContext>setprotected QueueReader<MethodOrMethodContext>unprocessedMethods
-
Constructor Summary
Constructors Constructor Description ReachableMethods(CallGraph graph, Collection<? extends MethodOrMethodContext> entryPoints)ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints)ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints, Filter filter)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddMethod(MethodOrMethodContext m)protected voidaddMethods(Iterator<? extends MethodOrMethodContext> methods)booleancontains(MethodOrMethodContext m)Returns true iff method is reachable.QueueReader<MethodOrMethodContext>listener()Returns a QueueReader object containing all methods found reachable so far, and which will be informed of any new methods that are later found to be reachable.QueueReader<MethodOrMethodContext>newListener()Returns a QueueReader object which will contain ONLY NEW methods which will be found to be reachable, but not those that have already been found to be reachable.intsize()Returns the number of methods that are reachable.voidupdate()Causes the QueueReader objects to be filled up with any methods that have become reachable since the last call.
-
-
-
Field Detail
-
reachables
protected final ChunkedQueue<MethodOrMethodContext> reachables
-
set
protected final Set<MethodOrMethodContext> set
-
allReachables
protected final QueueReader<MethodOrMethodContext> allReachables
-
unprocessedMethods
protected QueueReader<MethodOrMethodContext> unprocessedMethods
-
cg
protected CallGraph cg
-
filter
protected Filter filter
-
-
Constructor Detail
-
ReachableMethods
public ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints, Filter filter)
-
ReachableMethods
public ReachableMethods(CallGraph graph, Iterator<? extends MethodOrMethodContext> entryPoints)
-
ReachableMethods
public ReachableMethods(CallGraph graph, Collection<? extends MethodOrMethodContext> entryPoints)
-
-
Method Detail
-
addMethods
protected void addMethods(Iterator<? extends MethodOrMethodContext> methods)
-
addMethod
protected void addMethod(MethodOrMethodContext m)
-
update
public void update()
Causes the QueueReader objects to be filled up with any methods that have become reachable since the last call.
-
listener
public QueueReader<MethodOrMethodContext> listener()
Returns a QueueReader object containing all methods found reachable so far, and which will be informed of any new methods that are later found to be reachable.
-
newListener
public QueueReader<MethodOrMethodContext> newListener()
Returns a QueueReader object which will contain ONLY NEW methods which will be found to be reachable, but not those that have already been found to be reachable.
-
contains
public boolean contains(MethodOrMethodContext m)
Returns true iff method is reachable.
-
size
public int size()
Returns the number of methods that are reachable.
-
-