public class PrunedCallGraph extends Object implements CallGraph
Constructor and Description |
---|
PrunedCallGraph(CallGraph cg,
Set<CGNode> keep) |
Modifier and Type | Method and Description |
---|---|
void |
addEdge(CGNode src,
CGNode dst) |
void |
addNode(CGNode n)
add a node to this graph
|
boolean |
containsNode(CGNode n) |
IClassHierarchy |
getClassHierarchy() |
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) |
Set<CGNode> |
getNodes(MethodReference m) |
int |
getNumber(CGNode N) |
int |
getNumberOfNodes() |
int |
getNumberOfTargets(CGNode node,
CallSiteReference site) |
Iterator<CallSiteReference> |
getPossibleSites(CGNode src,
CGNode target) |
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)
Return the number of
immediate predecessor nodes of n |
IntSet |
getPredNodeNumbers(CGNode node) |
Iterator<CGNode> |
getPredNodes(CGNode n)
Return an
Iterator over the immediate predecessor nodes of n
This method never returns null . |
int |
getSuccNodeCount(CGNode n)
Return the number of
immediate successor nodes of this Node in the Graph |
IntSet |
getSuccNodeNumbers(CGNode node) |
Iterator<CGNode> |
getSuccNodes(CGNode n)
Return an Iterator over the immediate successor nodes of n
|
boolean |
hasEdge(CGNode src,
CGNode dst) |
Iterator<CGNode> |
iterateNodes(IntSet s) |
Iterator<CGNode> |
iterator() |
void |
removeAllIncidentEdges(CGNode node) |
void |
removeEdge(CGNode src,
CGNode dst) |
void |
removeIncomingEdges(CGNode node) |
void |
removeNode(CGNode n)
remove a node from this graph
|
void |
removeNodeAndEdges(CGNode n)
remove a node and all its incident edges
|
void |
removeOutgoingEdges(CGNode node) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public void removeNodeAndEdges(CGNode n) throws UnsupportedOperationException
Graph
removeNodeAndEdges
in interface Graph<CGNode>
UnsupportedOperationException
- if the graph implementation does not allow removalpublic int getNumberOfNodes()
getNumberOfNodes
in interface NodeManager<CGNode>
public void addNode(CGNode n)
NodeManager
addNode
in interface NodeManager<CGNode>
public void removeNode(CGNode n) throws UnsupportedOperationException
NodeManager
removeNode
in interface NodeManager<CGNode>
UnsupportedOperationException
public boolean containsNode(CGNode n)
containsNode
in interface NodeManager<CGNode>
public Iterator<CGNode> getPredNodes(CGNode n)
EdgeManager
Iterator
over the immediate predecessor nodes of n
This method never returns null
.getPredNodes
in interface EdgeManager<CGNode>
Iterator
over the immediate predecessor nodes of this Node.public int getPredNodeCount(CGNode n)
EdgeManager
immediate predecessor
nodes of ngetPredNodeCount
in interface EdgeManager<CGNode>
public Iterator<CGNode> getSuccNodes(CGNode n)
EdgeManager
This method never returns null
.
getSuccNodes
in interface EdgeManager<CGNode>
public int getSuccNodeCount(CGNode n)
EdgeManager
immediate successor
nodes of this Node in the GraphgetSuccNodeCount
in interface EdgeManager<CGNode>
public void addEdge(CGNode src, CGNode dst)
addEdge
in interface EdgeManager<CGNode>
public void removeEdge(CGNode src, CGNode dst) throws UnsupportedOperationException
removeEdge
in interface EdgeManager<CGNode>
UnsupportedOperationException
public void removeAllIncidentEdges(CGNode node) throws UnsupportedOperationException
removeAllIncidentEdges
in interface EdgeManager<CGNode>
UnsupportedOperationException
public void removeIncomingEdges(CGNode node) throws UnsupportedOperationException
removeIncomingEdges
in interface EdgeManager<CGNode>
UnsupportedOperationException
public void removeOutgoingEdges(CGNode node) throws UnsupportedOperationException
removeOutgoingEdges
in interface EdgeManager<CGNode>
UnsupportedOperationException
public boolean hasEdge(CGNode src, CGNode dst)
hasEdge
in interface EdgeManager<CGNode>
public int getNumber(CGNode N)
getNumber
in interface NumberedNodeManager<CGNode>
public CGNode getNode(int number)
getNode
in interface NumberedNodeManager<CGNode>
public int getMaxNumber()
getMaxNumber
in interface NumberedNodeManager<CGNode>
public Iterator<CGNode> iterateNodes(IntSet s)
iterateNodes
in interface NumberedNodeManager<CGNode>
public IntSet getSuccNodeNumbers(CGNode node)
getSuccNodeNumbers
in interface NumberedEdgeManager<CGNode>
public IntSet getPredNodeNumbers(CGNode node)
getPredNodeNumbers
in interface NumberedEdgeManager<CGNode>
public CGNode getFakeRootNode()
CallGraph
root node
of the call graph.getFakeRootNode
in interface CallGraph
public CGNode getFakeWorldClinitNode()
getFakeWorldClinitNode
in interface CallGraph
public Collection<CGNode> getEntrypointNodes()
getEntrypointNodes
in interface CallGraph
public CGNode getNode(IMethod method, Context C)
CallGraph
getNodes
public Set<CGNode> getNodes(MethodReference m)
public IClassHierarchy getClassHierarchy()
getClassHierarchy
in interface CallGraph
public Set<CGNode> getPossibleTargets(CGNode node, CallSiteReference site)
CallGraph
getPossibleTargets
in interface CallGraph
public int getNumberOfTargets(CGNode node, CallSiteReference site)
getNumberOfTargets
in interface CallGraph
public Iterator<CallSiteReference> getPossibleSites(CGNode src, CGNode target)
getPossibleSites
in interface CallGraph