Class PartialCallGraph
java.lang.Object
com.ibm.wala.util.graph.impl.DelegatingGraph<CGNode>
com.ibm.wala.ipa.callgraph.impl.PartialCallGraph
- All Implemented Interfaces:
CallGraph
,EdgeManager<CGNode>
,Graph<CGNode>
,NodeManager<CGNode>
,NumberedEdgeManager<CGNode>
,NumberedGraph<CGNode>
,NumberedNodeManager<CGNode>
,Iterable<CGNode>
a view of a portion of a call graph.
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
PartialCallGraph
(CallGraph cg, Collection<CGNode> partialRoots, Graph<CGNode> partialGraph) -
Method Summary
Modifier and TypeMethodDescriptionReturn the (fake) interproceduralroot node
of the call graph.int
getNode
(int index) If you want to get all the nodes corresponding to a particular method, regardless of context, then usegetNodes
int
int
getNumberOfTargets
(CGNode node, CallSiteReference site) getPossibleSites
(CGNode src, CGNode target) getPossibleTargets
(CGNode node, CallSiteReference site) Return the set of CGNodes that represent possible targets of a particular call site from a particular nodegetPredNodeNumbers
(CGNode node) getSuccNodeNumbers
(CGNode node) iterateNodes
(IntSet nodes) static PartialCallGraph
make
(CallGraph cg, Collection<CGNode> partialRoots) static PartialCallGraph
make
(CallGraph cg, Collection<CGNode> partialRoots, Collection<CGNode> nodes) Methods inherited from class com.ibm.wala.util.graph.impl.DelegatingGraph
addEdge, addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.ibm.wala.util.graph.EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdges
Methods inherited from interface com.ibm.wala.util.graph.Graph
removeNodeAndEdges
Methods inherited from interface java.lang.Iterable
forEach, spliterator
Methods inherited from interface com.ibm.wala.util.graph.NodeManager
addNode, containsNode, getNumberOfNodes, iterator, removeNode, stream
-
Field Details
-
cg
-
partialRoots
-
-
Constructor Details
-
PartialCallGraph
protected PartialCallGraph(CallGraph cg, Collection<CGNode> partialRoots, Graph<CGNode> partialGraph)
-
-
Method Details
-
make
public static PartialCallGraph make(CallGraph cg, Collection<CGNode> partialRoots, Collection<CGNode> nodes) - Parameters:
cg
- the original call graphpartialRoots
- roots of the new, partial graphnodes
- set of nodes that will be included in the new, partial call graph
-
make
- Parameters:
cg
- the original call graphpartialRoots
- roots of the new, partial graph the result contains only nodes reachable from the partialRoots in the original call graph.
-
getFakeRootNode
Description copied from interface:CallGraph
Return the (fake) interproceduralroot node
of the call graph.- Specified by:
getFakeRootNode
in interfaceCallGraph
- Returns:
- the "fake" root node the call graph
- Throws:
UnsupportedOperationException
-
getFakeWorldClinitNode
- Specified by:
getFakeWorldClinitNode
in interfaceCallGraph
- Throws:
UnsupportedOperationException
-
getEntrypointNodes
- Specified by:
getEntrypointNodes
in interfaceCallGraph
- Returns:
- an Iterator of the nodes designated as "root nodes"
-
getNode
-
getNodes
-
getClassHierarchy
- Specified by:
getClassHierarchy
in interfaceCallGraph
- Returns:
- the governing class hierarchy for this call graph
-
iterateNodes
- Specified by:
iterateNodes
in interfaceNumberedNodeManager<CGNode>
- Returns:
- iterator of nodes with the numbers in set s
-
getMaxNumber
public int getMaxNumber()- Specified by:
getMaxNumber
in interfaceNumberedNodeManager<CGNode>
-
getNode
- Specified by:
getNode
in interfaceNumberedNodeManager<CGNode>
-
getNumber
- Specified by:
getNumber
in interfaceNumberedNodeManager<CGNode>
-
getSuccNodeNumbers
- Specified by:
getSuccNodeNumbers
in interfaceNumberedEdgeManager<CGNode>
- Returns:
- the numbers identifying the immediate successors of node
-
getPredNodeNumbers
- Specified by:
getPredNodeNumbers
in interfaceNumberedEdgeManager<CGNode>
- Returns:
- the numbers identifying the immediate predecessors of node
-
getNumberOfTargets
- Specified by:
getNumberOfTargets
in interfaceCallGraph
- Returns:
- the number of nodes that the call site may dispatch to
-
getPossibleSites
- Specified by:
getPossibleSites
in interfaceCallGraph
- Returns:
- iterator of CallSiteReference, the call sites in a node that might dispatch to the target node.
-
getPossibleTargets
Description copied from interface:CallGraph
Return the set of CGNodes that represent possible targets of a particular call site from a particular node- Specified by:
getPossibleTargets
in interfaceCallGraph
-