public class PrunedCallGraph extends java.lang.Object implements CallGraph
| Constructor and Description |
|---|
PrunedCallGraph(CallGraph cg,
java.util.Set<CGNode> keep)
Create a pruned (filtered) view of an existing call graph.
|
PrunedCallGraph(CallGraph cg,
java.util.Set<CGNode> keep,
java.util.Map<CGNode,java.util.Set<CGNode>> remove) |
| Modifier and Type | Method and Description |
|---|---|
void |
addEdge(CGNode src,
CGNode dst) |
void |
addNode(CGNode n) |
boolean |
containsNode(CGNode n) |
IClassHierarchy |
getClassHierarchy() |
java.util.Collection<CGNode> |
getEntrypointNodes() |
CGNode |
getFakeRootNode()
Return the (fake) interprocedural
root node of the call graph. |
CGNode |
getFakeWorldClinitNode() |
int |
getMaxNumber() |
CGNode |
getNode(IMethod method,
Context C)
If you want to get all the nodes corresponding to a particular method, regardless of
context, then use
getNodes |
CGNode |
getNode(int number) |
java.util.Set<CGNode> |
getNodes(MethodReference m) |
int |
getNumber(CGNode N) |
int |
getNumberOfNodes() |
int |
getNumberOfTargets(CGNode node,
CallSiteReference site) |
java.util.Iterator<CallSiteReference> |
getPossibleSites(CGNode src,
CGNode target) |
java.util.Set<CGNode> |
getPossibleTargets(CGNode node,
CallSiteReference site)
Return the set of CGNodes that represent possible targets of a particular call site from a
particular node
|
int |
getPredNodeCount(CGNode n) |
com.ibm.wala.util.intset.IntSet |
getPredNodeNumbers(CGNode node) |
java.util.Iterator<CGNode> |
getPredNodes(CGNode n) |
int |
getSuccNodeCount(CGNode n) |
com.ibm.wala.util.intset.IntSet |
getSuccNodeNumbers(CGNode node) |
java.util.Iterator<CGNode> |
getSuccNodes(CGNode n) |
boolean |
hasEdge(CGNode src,
CGNode dst) |
java.util.Iterator<CGNode> |
iterateNodes(com.ibm.wala.util.intset.IntSet s) |
java.util.Iterator<CGNode> |
iterator() |
void |
removeAllIncidentEdges(CGNode node) |
void |
removeEdge(CGNode src,
CGNode dst) |
void |
removeIncomingEdges(CGNode node) |
void |
removeNode(CGNode n) |
void |
removeNodeAndEdges(CGNode n) |
void |
removeOutgoingEdges(CGNode node) |
java.util.stream.Stream<CGNode> |
stream() |
public PrunedCallGraph(CallGraph cg, java.util.Set<CGNode> keep)
Note: the created instance retains references to cg and keep without making
private copies thereof. Be cautious if subsequently modifying cg or keep
outside of this class's control. In particular, keep must always be a subset of the
nodes in cg or else unexpected behavior may arise.
cg - Underlying call graph to prunekeep - Subset of cg nodes to include in the pruned graphjava.lang.IllegalArgumentException - if any keep node is not a node in cgpublic void removeNodeAndEdges(CGNode n) throws java.lang.UnsupportedOperationException
removeNodeAndEdges in interface com.ibm.wala.util.graph.Graph<CGNode>java.lang.UnsupportedOperationExceptionpublic java.util.Iterator<CGNode> iterator()
public java.util.stream.Stream<CGNode> stream()
stream in interface com.ibm.wala.util.graph.NodeManager<CGNode>public int getNumberOfNodes()
getNumberOfNodes in interface com.ibm.wala.util.graph.NodeManager<CGNode>public void addNode(CGNode n)
addNode in interface com.ibm.wala.util.graph.NodeManager<CGNode>public void removeNode(CGNode n) throws java.lang.UnsupportedOperationException
removeNode in interface com.ibm.wala.util.graph.NodeManager<CGNode>java.lang.UnsupportedOperationExceptionpublic boolean containsNode(CGNode n)
containsNode in interface com.ibm.wala.util.graph.NodeManager<CGNode>public java.util.Iterator<CGNode> getPredNodes(CGNode n)
getPredNodes in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public int getPredNodeCount(CGNode n)
getPredNodeCount in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public java.util.Iterator<CGNode> getSuccNodes(CGNode n)
getSuccNodes in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public int getSuccNodeCount(CGNode n)
getSuccNodeCount in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public void addEdge(CGNode src, CGNode dst)
addEdge in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public void removeEdge(CGNode src, CGNode dst) throws java.lang.UnsupportedOperationException
removeEdge in interface com.ibm.wala.util.graph.EdgeManager<CGNode>java.lang.UnsupportedOperationExceptionpublic void removeAllIncidentEdges(CGNode node) throws java.lang.UnsupportedOperationException
removeAllIncidentEdges in interface com.ibm.wala.util.graph.EdgeManager<CGNode>java.lang.UnsupportedOperationExceptionpublic void removeIncomingEdges(CGNode node) throws java.lang.UnsupportedOperationException
removeIncomingEdges in interface com.ibm.wala.util.graph.EdgeManager<CGNode>java.lang.UnsupportedOperationExceptionpublic void removeOutgoingEdges(CGNode node) throws java.lang.UnsupportedOperationException
removeOutgoingEdges in interface com.ibm.wala.util.graph.EdgeManager<CGNode>java.lang.UnsupportedOperationExceptionpublic boolean hasEdge(CGNode src, CGNode dst)
hasEdge in interface com.ibm.wala.util.graph.EdgeManager<CGNode>public int getNumber(CGNode N)
getNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<CGNode>public CGNode getNode(int number)
getNode in interface com.ibm.wala.util.graph.NumberedNodeManager<CGNode>public int getMaxNumber()
getMaxNumber in interface com.ibm.wala.util.graph.NumberedNodeManager<CGNode>public java.util.Iterator<CGNode> iterateNodes(com.ibm.wala.util.intset.IntSet s)
iterateNodes in interface com.ibm.wala.util.graph.NumberedNodeManager<CGNode>public com.ibm.wala.util.intset.IntSet getSuccNodeNumbers(CGNode node)
getSuccNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<CGNode>public com.ibm.wala.util.intset.IntSet getPredNodeNumbers(CGNode node)
getPredNodeNumbers in interface com.ibm.wala.util.graph.NumberedEdgeManager<CGNode>public CGNode getFakeRootNode()
CallGraphroot node of the call graph.getFakeRootNode in interface CallGraphpublic CGNode getFakeWorldClinitNode()
getFakeWorldClinitNode in interface CallGraphpublic java.util.Collection<CGNode> getEntrypointNodes()
getEntrypointNodes in interface CallGraphpublic CGNode getNode(IMethod method, Context C)
CallGraphgetNodespublic java.util.Set<CGNode> getNodes(MethodReference m)
public IClassHierarchy getClassHierarchy()
getClassHierarchy in interface CallGraphpublic java.util.Set<CGNode> getPossibleTargets(CGNode node, CallSiteReference site)
CallGraphgetPossibleTargets in interface CallGraphpublic int getNumberOfTargets(CGNode node, CallSiteReference site)
getNumberOfTargets in interface CallGraphpublic java.util.Iterator<CallSiteReference> getPossibleSites(CGNode src, CGNode target)
getPossibleSites in interface CallGraph