Package org.jtool.cfg

Class CallGraph

java.lang.Object
org.jtool.cfg.CallGraph

public class CallGraph extends Object
An object storing information about a call graph.
  • Constructor Details

    • CallGraph

      public CallGraph(String name)
      Creates a call graph having a given name.
      Parameters:
      name - the name of this call graph
  • Method Details

    • getName

      public String getName()
      Returns the name of this call graph
      Returns:
      the call graph name
    • getNodes

      public Set<CFGEntry> getNodes()
      Returns all nodes of this call graph.
      Returns:
      the collection of the nodes
    • getEdges

      public Set<ControlFlow> getEdges()
      Returns all edges of this call graph.
      Returns:
      the collection of the edges
    • append

      public void append(CallGraph graph)
      Appends a given call graph to this call graph. This method is not intended to be invoked by clients.
      Parameters:
      graph - the call graph to be appended
    • setCall

      public void setCall(CFGEntry caller, CFGEntry callee)
      Sets a call flow edge in this call graph. This method is not intended to be invoked by clients.
      Parameters:
      caller - a node for the caller site
      callee - a node for the callee site
    • getCalleeNodes

      public Set<CFGEntry> getCalleeNodes(CFGEntry caller)
      Returns nodes corresponding to methods that a method for a given node calls.
      Parameters:
      caller - the node for the caller site
      Returns:
      the collection of callee sites
    • getCallerNodes

      public Set<CFGEntry> getCallerNodes(CFGNode callee)
      Returns nodes corresponding to methods that calls a method for a given node.
      Parameters:
      callee - the node for the callee site
      Returns:
      the collection of caller sites
    • getCallFlowsFrom

      public Set<ControlFlow> getCallFlowsFrom(CFGNode node)
      Finds a call flow edge outgoing from a given node.
      Parameters:
      node - the CFG node having the outgoing edge
      Returns:
      the collection of the call flow edges
    • print

      public void print()
      Displays information on this call graph.
    • toString

      public String toString()
      Obtains information on this call graph.
      Overrides:
      toString in class Object
      Returns:
      the string representing the information