Class WhenClause

java.lang.Object
dev.frostlake.executor.expressions.WhenClause

public class WhenClause extends Object
  • Constructor Details

    • WhenClause

      public WhenClause(Expression condition, Expression result)
    • WhenClause

      public WhenClause(Expression condition, Expression result, boolean operandMatch)
      A WHEN of either CASE form.
      Parameters:
      condition - the condition, for a simple CASE the operand's equality to the WHEN value
      result - the THEN result
      operandMatch - whether the condition matches a simple CASE's operand against its WHEN value
  • Method Details

    • getCondition

      public Expression getCondition()
    • getResult

      public Expression getResult()
    • isOperandMatch

      public boolean isOperandMatch()
      Whether this WHEN belongs to a simple CASE (CASE x WHEN v THEN r), whose condition is the operand's equality to the value. The planner matches such a value as it matches a DECODE search, which it does not do for a searched CASE's condition: live settles CASE n WHEN 7 THEN … as never taken over a column holding a NULL, and leaves CASE WHEN n = 7 THEN … open.
      Returns:
      true for a simple CASE's WHEN