Interface Operand

All Known Implementing Classes:
ArrayConstruction, AttributeOperand, BinaryArithmeticExpression, BooleanOperand, CollateOperand, ConditionOperand, DateOperand, DurationOperand, FunctionCall, NullOperand, NumberOperand, ParameterOperand, ScalarSubqueryOperand, SetLiteralOperand, StringOperand, StructConstruction, TimeOperand, TimestampOperand, UnaryOperand

Root sealed interface for scalar value expressions used in projections and predicates.

Operands include column references (AttributeOperand), literals (NumberOperand, StringOperand, BooleanOperand, and the typed temporal literals DateOperand, TimeOperand, TimestampOperand, DurationOperand), arithmetic expressions (BinaryArithmeticExpression, UnaryOperand), function invocations (FunctionCall), and set literals (SetLiteralOperand).

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    <R> R
    accept(OperandVisitor<R> visitor)
     
    Returns the source location of the first token of this operand.
    default String
    This operand as Relix text, writing the operators of any condition it holds as glyphs.
    default String
    This operand as Relix text that parses back to an equal operand, source locations aside: price * qty, UCase(name), "it\"s".
  • Method Details

    • accept

      <R> R accept(OperandVisitor<R> visitor)
    • location

      SourceLocation location()
      Returns the source location of the first token of this operand.
    • prettyPrint

      default String prettyPrint()
      This operand as Relix text, writing the operators of any condition it holds as glyphs. The same as prettyPrint(Spelling.GLYPHS).
      Returns:
      the operand as .relix text; never null
      Since:
      1.0
    • prettyPrint

      default String prettyPrint(Spelling spelling)
      This operand as Relix text that parses back to an equal operand, source locations aside: price * qty, UCase(name), "it\"s". Parentheses appear only where precedence needs them, and a column whose name is a reserved word is written in backticks.

      spelling chooses how the operators of a condition the operand holds are written, as RelNode.prettyPrint(Spelling) does: IIf(a ≥ 1, x, y) for Spelling.GLYPHS, IIf(a >= 1, x, y) for Spelling.KEYWORDS.

      Parameters:
      spelling - glyphs or ASCII keywords; must not be null
      Returns:
      the operand as .relix text; never null
      Since:
      1.0