Class CallGraphNode


  • public class CallGraphNode
    extends Object
    A call-graph node for a single method, tracking its incoming (caller) and outgoing (callee) call sites.
    • Constructor Detail

      • CallGraphNode

        public CallGraphNode​(MethodReference reference,
                             MethodEntry methodEntry)
        Creates a node for the given method.
        Parameters:
        reference - the method this node represents
        methodEntry - 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object