Package org.jtool.cfg

Class CFGMethodEntry


public class CFGMethodEntry extends CFGEntry
The entry node for a CFG for a method or a constructor.
  • Constructor Details

    • CFGMethodEntry

      public CFGMethodEntry(JavaMethod jmethod, CFGNode.Kind kind)
      Creates a new object that represents an entry for a method. This method is not intended to be invoked by clients.
      Parameters:
      jmethod - the method associated with this entry node
      kind - the kind of this node
  • Method Details

    • getJavaMethod

      public JavaMethod getJavaMethod()
      Returns the method associated with this entry node.
      Returns:
      the associated method
    • addFormalIn

      public void addFormalIn(CFGParameter node)
      Adds a formal-in node to this method entry node. This method is not intended to be invoked by clients.
      Parameters:
      node - the formal-in node to be added
    • setFormalIns

      public void setFormalIns(List<CFGParameter> nodes)
      Sets formal-in nodes to this method entry node. This method is not intended to be invoked by clients.
      Parameters:
      nodes - the collection of the formal-in nodes to be set
    • setFormalOut

      public void setFormalOut(CFGParameter node)
      Sets a formal-out node for the return value to this method entry node.
      Parameters:
      node - the formal-out node to be set
    • getFormalIns

      public List<CFGParameter> getFormalIns()
      Returns formal-in nodes of the method associated to this entry node.
      Returns:
      the collection of the formal-in nodes
    • getParameterSize

      public int getParameterSize()
      Returns the number of parameters of the method associated to this entry node.
      Returns:
      the number of the parameters
    • getFormalIn

      public CFGParameter getFormalIn(int index)
      Returns an formal-in node of a parameter specified by the index.
      Parameters:
      index - the index number of the parameter to be retrieved
      Returns:
      the found formal-in node, or null if no parameter is found
    • getFormalOut

      public CFGParameter getFormalOut()
      Returns an formal-out node of a parameter for the return value.
      Returns:
      the formal-out node for the return value
    • hasParameters

      public boolean hasParameters()
      Tests if the method associated to this entry node has a parameter.
      Returns:
      true if any parameter exists, otherwise false
    • addExceptionNode

      public void addExceptionNode(CFGException node)
      Adds an exception node to this method entry. This method is not intended to be invoked by clients.
      Parameters:
      node - the exception node to be added
    • getExceptionNodes

      public List<CFGException> getExceptionNodes()
      Returns the exception nodes corresponding to throws on this method entry.
      Returns:
      the collection of the exception nodes
    • getExceptionNode

      public CFGException getExceptionNode(String type)
      Finds the exception node related to a specified type/
      Parameters:
      type - the type of the exception
      Returns:
      the found exception node, or null if no exception type is found
    • toString

      public String toString()
      Obtains information on this node.
      Overrides:
      toString in class CFGNode
      Returns:
      the string representing the information