Class ObjectCreationNode

java.lang.Object
org.checkerframework.dataflow.cfg.node.Node
org.checkerframework.dataflow.cfg.node.ObjectCreationNode
All Implemented Interfaces:
org.plumelib.util.UniqueId

public class ObjectCreationNode extends Node
A node for new object creation.
   new constructor(arg1, arg2, ...)
   enclosingExpression.new constructor(arg1, arg2, ...)
 
  • Field Details

    • tree

      protected final NewClassTree tree
      The tree for the object creation.
    • enclosingExpression

      protected final @Nullable Node enclosingExpression
      The enclosing expression of the object creation or null.
    • constructor

      protected final Node constructor
      The constructor node of the object creation.
    • arguments

      protected final List<Node> arguments
      The arguments of the object creation.
    • classbody

      protected final @Nullable ClassDeclarationNode classbody
      Class body for anonymous classes, otherwise null.
  • Constructor Details

    • ObjectCreationNode

      public ObjectCreationNode(NewClassTree tree, @Nullable Node enclosingExpr, Node constructor, List<Node> arguments, @Nullable ClassDeclarationNode classbody)
      Constructs a ObjectCreationNode.
      Parameters:
      tree - the NewClassTree
      enclosingExpr - the enclosing expression Node if it exists, or null
      constructor - the constructor node
      arguments - the passed arguments
      classbody - the ClassDeclarationNode
  • Method Details

    • getConstructor

      @Pure public Node getConstructor()
      Returns the constructor node.
      Returns:
      the constructor node
    • getArguments

      @Pure public List<Node> getArguments()
      Returns the explicit arguments to the object creation.
      Returns:
      the arguments
    • getArgument

      @Pure public Node getArgument(int i)
      Returns the i-th explicit argument to the object creation.
      Parameters:
      i - the index of the argument
      Returns:
      the argument
    • getEnclosingExpression

      @Pure public @Nullable Node getEnclosingExpression()
      Returns the enclosing expression node, which only exists if it is an inner class instantiation.
      Returns:
      the enclosing type expression node
    • getClassBody

      @Pure public @Nullable Node getClassBody()
      Returns the classbody.
      Returns:
      the classbody
    • getTree

      @Pure public NewClassTree getTree()
      Description copied from class: Node
      Returns the Tree in the abstract syntax tree, or null if no corresponding tree exists. For instance, this is the case for an ImplicitThisNode.
      Specified by:
      getTree in class Node
      Returns:
      the corresponding Tree or null
    • accept

      public <R, P> R accept(NodeVisitor<R,P> visitor, P p)
      Description copied from class: Node
      Accept method of the visitor pattern.
      Specified by:
      accept in class Node
      Type Parameters:
      R - result type of the operation
      P - parameter type
      Parameters:
      visitor - the visitor to be applied to this node
      p - the parameter for this operation
    • toString

      @SideEffectFree public String toString()
      Overrides:
      toString in class Object
    • equals

      @Pure public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      @SideEffectFree public int hashCode()
      Overrides:
      hashCode in class Object
    • getOperands

      @SideEffectFree public Collection<Node> getOperands()
      Description copied from class: Node
      Returns a collection containing all of the operand Nodes of this Node.
      Specified by:
      getOperands in class Node
      Returns:
      a collection containing all of the operand Nodes of this Node