Package com.tonic.analysis.callgraph
Class CallGraphNode
- java.lang.Object
-
- com.tonic.analysis.callgraph.CallGraphNode
-
public class CallGraphNode extends Object
A call-graph node for a single method, tracking its incoming (caller) and outgoing (callee) call sites.
-
-
Constructor Summary
Constructors Constructor Description CallGraphNode(MethodReference reference, MethodEntry methodEntry)Creates a node for the given method.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)intgetCallCount()intgetCalleeCount()Set<MethodReference>getCallees()Collects the distinct methods called by this method.Set<MethodReference>getCallers()Collects the distinct methods that call this method.Set<CallSite>getIncomingCalls()MethodEntrygetMethodEntry()Set<CallSite>getOutgoingCalls()MethodReferencegetReference()booleanhasCallees()booleanhasCaller()inthashCode()booleanisInPool()StringtoString()
-
-
-
Constructor Detail
-
CallGraphNode
public CallGraphNode(MethodReference reference, MethodEntry methodEntry)
Creates a node for the given method.- Parameters:
reference- the method this node representsmethodEntry- the parsed method, or null if the method is external to the pool
-
-
Method Detail
-
getReference
public MethodReference getReference()
- Returns:
- the reference
-
getMethodEntry
public MethodEntry getMethodEntry()
- Returns:
- the method entry, or null for methods outside the ClassPool
-
isInPool
public boolean isInPool()
- Returns:
- true if this method is in the ClassPool (not external)
-
getIncomingCalls
public Set<CallSite> getIncomingCalls()
- Returns:
- an unmodifiable view of the call sites where this method is called
-
getOutgoingCalls
public Set<CallSite> getOutgoingCalls()
- Returns:
- an unmodifiable view of the call sites made from this method
-
getCallers
public Set<MethodReference> getCallers()
Collects the distinct methods that call this method.- Returns:
- the caller method references
-
getCallees
public Set<MethodReference> getCallees()
Collects the distinct methods called by this method.- Returns:
- the callee method references
-
getCallCount
public int getCallCount()
- Returns:
- the number of incoming call sites
-
getCalleeCount
public int getCalleeCount()
- Returns:
- the number of outgoing call sites
-
hasCaller
public boolean hasCaller()
- Returns:
- true if this method has at least one caller
-
hasCallees
public boolean hasCallees()
- Returns:
- true if this method calls at least one other method
-
-