java.lang.Object
java.util.AbstractMap
Util.Collections.UnmodifiableMultiMap
Compil3r.Quad.CallGraph
Compil3r.Quad.LoadedCallGraph
- All Implemented Interfaces:
- Util.Collections.BinaryRelation, Util.Graphs.Graph, java.util.Map, Util.Collections.MultiMap
- public class LoadedCallGraph
- extends CallGraph
A call graph that is loaded from a file.
- Version:
- $Id: LoadedCallGraph.java,v 1.4 2003/07/22 22:38:47 joewhaley Exp $
| Nested classes inherited from class java.util.AbstractMap |
|
| Nested classes inherited from class java.util.Map |
java.util.Map.Entry |
| Methods inherited from class Compil3r.Quad.CallGraph |
calculateBackEdges, calculateEdgeRelation, calculateReachableMethods, contains, findDepths, getCallees, getCallGraphMap, getCallSiteMap, getCallSites, getCallSites0, getCallSites0, getCallSites1, getNavigator, getTargetMethod, getTargetMethods, getValues, numberOfTargetMethods, numberOfTargetMethods, toString |
| Methods inherited from class Util.Collections.UnmodifiableMultiMap |
add, addAll, addAll, clear, computeHistogram, computeHistogram, entrySetHelper, proxy, put, putAll, remove, remove, removeAll, retainAll |
methods
protected java.util.Set methods
roots
protected java.util.Set roots
callSites
protected Util.Collections.MultiMap callSites
edges
protected Util.Collections.InvertibleMultiMap edges
LoadedCallGraph
public LoadedCallGraph(java.lang.String filename)
throws java.io.IOException
write
public static void write(CallGraph cg,
java.io.PrintWriter out)
throws java.io.IOException
read
protected void read(java.io.BufferedReader in)
throws java.io.IOException
add
public void add(Clazz.jq_Method caller,
int bcIndex,
Clazz.jq_Method callee)
setRoots
public void setRoots(java.util.Collection roots)
- Description copied from class:
CallGraph
- Sets up the root methods to be the given set. Later call graph queries
use the value that you pass in here. Implementing this method is
optional -- it is only necessary if you use methods that require a root
set, like getReachableMethods().
- Specified by:
setRoots in class CallGraph
getRoots
public java.util.Collection getRoots()
- Specified by:
getRoots in interface Util.Graphs.Graph- Specified by:
getRoots in class CallGraph
getTargetMethods
public java.util.Collection getTargetMethods(java.lang.Object context,
ProgramLocation callSite)
- Description copied from class:
CallGraph
- Returns the possible target methods of the given call site under the given context.
The interpretation of the context object is specific to the type of call graph.
- Specified by:
getTargetMethods in class CallGraph
entrySet
public java.util.Set entrySet()
- Description copied from class:
Util.Collections.UnmodifiableMultiMap
- Returns a
Set view that allows you to recapture
the MultiMap view.
- Specified by:
entrySet in interface Util.Collections.MultiMap- Overrides:
entrySet in class CallGraph
getAllCallSites
public java.util.Collection getAllCallSites()
- Description copied from class:
CallGraph
- Returns the collection of all call sites in the call graph.
The default implementation just iterates through all of the methods
to build up the collection.
- Overrides:
getAllCallSites in class CallGraph
getAllMethods
public java.util.Collection getAllMethods()
- Description copied from class:
CallGraph
- Returns the collection of all methods in the call graph.
The default implementation recalculates the reachable
methods based on the root set.
- Overrides:
getAllMethods in class CallGraph
getCallees
public java.util.Collection getCallees(Clazz.jq_Method caller)
- Description copied from class:
CallGraph
- Returns the set of methods that are called by the given method.
- Overrides:
getCallees in class CallGraph
getCallers
public java.util.Collection getCallers(Clazz.jq_Method callee)
- Description copied from class:
CallGraph
- Returns the set of methods that can call the given method.
- Overrides:
getCallers in class CallGraph
getCallSites
public java.util.Collection getCallSites(Clazz.jq_Method caller)
- Description copied from class:
CallGraph
- Returns the set of call sites in the given method.
- Overrides:
getCallSites in class CallGraph
keySet
public java.util.Set keySet()
- Description copied from interface:
java.util.Map
- Returns a set view of the keys in this Map. The set is backed by the
map, so that changes in one show up in the other. Modifications made
while an iterator is in progress cause undefined behavior. If the set
supports removal, these methods remove the underlying mapping from
the map:
Iterator.remove, Set.remove,
removeAll, retainAll, and clear.
Element addition, via add or addAll, is
not supported via this set.