com.ibm.wala.ipa.callgraph.impl
Class BasicCallGraph.NodeImpl

java.lang.Object
  extended by com.ibm.wala.util.graph.impl.NodeWithNumber
      extended by com.ibm.wala.ipa.callgraph.impl.BasicCallGraph.NodeImpl
All Implemented Interfaces:
CGNode, ContextItem, INodeWithNumber
Direct Known Subclasses:
ExplicitCallGraph.ExplicitNode
Enclosing class:
BasicCallGraph

public abstract class BasicCallGraph.NodeImpl
extends NodeWithNumber
implements CGNode

A class that represents the a normal node in a call graph.


Field Summary
protected  IMethod method
          The method this node represents.
 
Constructor Summary
protected BasicCallGraph.NodeImpl(IMethod method, Context C)
           
 
Method Summary
abstract  boolean addTarget(CallSiteReference reference, CGNode target)
          Record that a particular call site might resolve to a call to a particular target node.
abstract  boolean equals(java.lang.Object obj)
           
 Context getContext()
          Return the context this CGNode represents.
 IMethod getMethod()
          Return the method this CGNode represents.
abstract  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.
abstract  int hashCode()
           
 java.lang.String toString()
           
 
Methods inherited from class com.ibm.wala.util.graph.impl.NodeWithNumber
getGraphNodeId, setGraphNodeId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ibm.wala.ipa.callgraph.CGNode
getCallGraph, getIR, getNumberOfTargets, getPossibleSites, iterateSites
 
Methods inherited from interface com.ibm.wala.util.graph.INodeWithNumber
getGraphNodeId, setGraphNodeId
 

Field Detail

method

protected final IMethod method
The method this node represents.

Constructor Detail

BasicCallGraph.NodeImpl

protected BasicCallGraph.NodeImpl(IMethod method,
                                  Context C)
Method Detail

getMethod

public IMethod getMethod()
Description copied from interface: CGNode
Return the method this CGNode represents. This value will never be null.

Specified by:
getMethod in interface CGNode
Returns:
the target IMethod for this CGNode.

getPossibleTargets

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

Specified by:
getPossibleTargets in interface CGNode

equals

public abstract boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(Object)

hashCode

public abstract int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getContext

public Context getContext()
Description copied from interface: CGNode
Return the context this CGNode represents. This value will never be null.

Specified by:
getContext in interface CGNode
Returns:
the Context for this CGNode.

addTarget

public abstract boolean addTarget(CallSiteReference reference,
                                  CGNode target)
Description copied from interface: CGNode
Record that a particular call site might resolve to a call to a particular target node. Returns true if this is a new target

Specified by:
addTarget in interface CGNode