com.ibm.wala.ipa.callgraph
Interface CGNode

All Superinterfaces:
ContextItem, INodeWithNumber
All Known Implementing Classes:
BasicCallGraph.NodeImpl, DelegatingExplicitCallGraph.DelegatingCGNode, ExplicitCallGraph.ExplicitNode

public interface CGNode
extends INodeWithNumber, ContextItem

Basic interface for a node in a call graph.


Method Summary
 boolean addTarget(CallSiteReference site, CGNode target)
          Record that a particular call site might resolve to a call to a particular target node.
 CallGraph getCallGraph()
           
 Context getContext()
          Return the context this CGNode represents.
 IR getIR(WarningSet warnings)
           
 IMethod getMethod()
          Return the method this CGNode represents.
 int getNumberOfTargets(CallSiteReference site)
           
 java.util.Iterator<CallSiteReference> getPossibleSites(CGNode target)
           
 java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)
          Return the set of CGNodes that represent possible targets of a particular call site when invoked in this context.
 java.util.Iterator<CallSiteReference> iterateSites()
           
 
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
 

Method Detail

getMethod

IMethod getMethod()
Return the method this CGNode represents. This value will never be null.

Returns:
the target IMethod for this CGNode.

getContext

Context getContext()
Return the context this CGNode represents. This value will never be null.

Returns:
the Context for this CGNode.

getPossibleTargets

java.util.Set<CGNode> getPossibleTargets(CallSiteReference site)
Return the set of CGNodes that represent possible targets of a particular call site when invoked in this context.


iterateSites

java.util.Iterator<CallSiteReference> iterateSites()
Returns:
Iterator of CallSiteReference

getPossibleSites

java.util.Iterator<CallSiteReference> getPossibleSites(CGNode target)
Parameters:
target -
Returns:
iterator of CallSiteReference, the call sites in this node that might dispatch to the target node.

addTarget

boolean addTarget(CallSiteReference site,
                  CGNode target)
Record that a particular call site might resolve to a call to a particular target node. Returns true if this is a new target


getNumberOfTargets

int getNumberOfTargets(CallSiteReference site)
Returns:
the number of nodes that the call site current may resolve to

getCallGraph

CallGraph getCallGraph()
Returns:
the call graph in which this node dwells

getIR

IR getIR(WarningSet warnings)
Returns:
the "default" IR for this node used by the governing call graph