Class EnclosedExpr

All Implemented Interfaces:
NodeWithRange<Node>, NodeWithTokenRange<Node>, Observable, Visitable, HasParentNode<Node>, Cloneable

public class EnclosedExpr extends Expression
An expression between ( ).
(1+1)
Author:
Julio Vilmar Gesser
  • Constructor Details

    • EnclosedExpr

      public EnclosedExpr()
    • EnclosedExpr

      public EnclosedExpr(Expression inner)
    • EnclosedExpr

      public EnclosedExpr(TokenRange tokenRange, Expression inner)
      This constructor is used by the parser and is considered private.
  • Method Details

    • accept

      public <R,​ A> R accept(GenericVisitor<R,​A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      R - the type of the return value of the visitor
      A - the type the user argument passed to the visitor
      Parameters:
      v - the visitor implementation
      arg - the argument passed to the visitor (of type A)
      Returns:
      the result of the visit (of type R)
    • accept

      public <A> void accept(VoidVisitor<A> v, A arg)
      Description copied from interface: Visitable
      Accept method for visitor support.
      Type Parameters:
      A - the type the argument passed for the visitor
      Parameters:
      v - the visitor implementation
      arg - any value relevant for the visitor (of type A)
    • getInner

      public Expression getInner()
    • setInner

      public EnclosedExpr setInner(Expression inner)
      Sets the inner expression
      Parameters:
      inner - the inner expression, can be null
      Returns:
      this, the EnclosedExpr
    • clone

      public EnclosedExpr clone()
      Overrides:
      clone in class Expression
    • getMetaModel

      public EnclosedExprMetaModel getMetaModel()
      Overrides:
      getMetaModel in class Expression
      Returns:
      get JavaParser specific node introspection information.
    • replace

      public boolean replace(Node node, Node replacementNode)
      Overrides:
      replace in class Node
    • isEnclosedExpr

      public boolean isEnclosedExpr()
      Overrides:
      isEnclosedExpr in class Expression
    • asEnclosedExpr

      public EnclosedExpr asEnclosedExpr()
      Overrides:
      asEnclosedExpr in class Expression
    • ifEnclosedExpr

      public void ifEnclosedExpr(Consumer<EnclosedExpr> action)
      Overrides:
      ifEnclosedExpr in class Expression
    • toEnclosedExpr

      public Optional<EnclosedExpr> toEnclosedExpr()
      Overrides:
      toEnclosedExpr in class Expression
    • isPolyExpression

      public boolean isPolyExpression()
      Description copied from class: Expression
      See https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.2
      Overrides:
      isPolyExpression in class Expression
      Returns:
      true if the expression is a poly expression