Class UnaryOperationExpression

java.lang.Object
dev.frostlake.executor.expressions.UnaryOperationExpression
All Implemented Interfaces:
Expression

public class UnaryOperationExpression extends Object implements Expression
Represents a unary operation (e.g., NOT x, -5, EXISTS(...))
  • Constructor Details

  • Method Details

    • getOperand

      public Expression getOperand()
    • getOperator

      public UnaryOperator getOperator()
    • getPosition

      public SourcePosition getPosition()
      The operator's own place in the parsed fragment — a sign is refused AT the sign: live anchors "Invalid argument types for function 'NEGATE': (BOOLEAN)" on the -, and the 'UNARY PLUS' twin on the +, wherever the operand starts.
      Returns:
      the recorded position, or null
    • setPosition

      public void setPosition(SourcePosition where)
    • accept

      public <T> T accept(ExpressionVisitor<T> visitor)
      Description copied from interface: Expression
      Accept a visitor for the visitor pattern
      Specified by:
      accept in interface Expression
    • toString

      public String toString()
      Overrides:
      toString in class Object