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
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPartialCallGraph(CallGraph cg, Collection<CGNode> partialRoots, Graph<CGNode> partialGraph) -
Method Summary
Modifier and TypeMethodDescriptionReturn the (fake) interproceduralroot nodeof the call graph.intgetNode(int index) If you want to get all the nodes corresponding to a particular method, regardless of context, then usegetNodesintintgetNumberOfTargets(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 PartialCallGraphmake(CallGraph cg, Collection<CGNode> partialRoots) static PartialCallGraphmake(CallGraph cg, Collection<CGNode> partialRoots, Collection<CGNode> nodes) Methods inherited from class DelegatingGraph
addEdge, addNode, containsNode, getNumberOfNodes, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, iterator, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeNode, removeNodeAndEdges, removeOutgoingEdges, stream, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface EdgeManager
addEdge, getPredNodeCount, getPredNodes, getSuccNodeCount, getSuccNodes, hasEdge, removeAllIncidentEdges, removeEdge, removeIncomingEdges, removeOutgoingEdgesMethods inherited from interface Graph
removeNodeAndEdgesMethods inherited from interface Iterable
forEach, spliteratorMethods inherited from interface 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:CallGraphReturn the (fake) interproceduralroot nodeof the call graph.- Specified by:
getFakeRootNodein interfaceCallGraph- Returns:
- the "fake" root node the call graph
- Throws:
UnsupportedOperationException
-
getFakeWorldClinitNode
- Specified by:
getFakeWorldClinitNodein interfaceCallGraph- Throws:
UnsupportedOperationException
-
getEntrypointNodes
- Specified by:
getEntrypointNodesin interfaceCallGraph- Returns:
- an Iterator of the nodes designated as "root nodes"
-
getNode
-
getNodes
-
getClassHierarchy
- Specified by:
getClassHierarchyin interfaceCallGraph- Returns:
- the governing class hierarchy for this call graph
-
iterateNodes
- Specified by:
iterateNodesin interfaceNumberedNodeManager<CGNode>- Returns:
- iterator of nodes with the numbers in set s
-
getMaxNumber
public int getMaxNumber()- Specified by:
getMaxNumberin interfaceNumberedNodeManager<CGNode>
-
getNode
- Specified by:
getNodein interfaceNumberedNodeManager<CGNode>
-
getNumber
- Specified by:
getNumberin interfaceNumberedNodeManager<CGNode>
-
getSuccNodeNumbers
- Specified by:
getSuccNodeNumbersin interfaceNumberedEdgeManager<CGNode>- Returns:
- the numbers identifying the immediate successors of node
-
getPredNodeNumbers
- Specified by:
getPredNodeNumbersin interfaceNumberedEdgeManager<CGNode>- Returns:
- the numbers identifying the immediate predecessors of node
-
getNumberOfTargets
- Specified by:
getNumberOfTargetsin interfaceCallGraph- Returns:
- the number of nodes that the call site may dispatch to
-
getPossibleSites
- Specified by:
getPossibleSitesin interfaceCallGraph- Returns:
- iterator of CallSiteReference, the call sites in a node that might dispatch to the target node.
-
getPossibleTargets
Description copied from interface:CallGraphReturn the set of CGNodes that represent possible targets of a particular call site from a particular node- Specified by:
getPossibleTargetsin interfaceCallGraph
-