All Implemented Interfaces:
BoxVisitable

public class SQLCase extends SQLExpression
Abstract Node class representing SQL case expression
  • Constructor Details

  • Method Details

    • getInputExpression

      public SQLExpression getInputExpression()
      Get the input expression
    • setInputExpression

      public void setInputExpression(SQLExpression inputExpression)
      Set the input expression
    • getWhenThens

      public List<SQLCaseWhenThen> getWhenThens()
      Get the when clauses
    • setWhenThens

      public void setWhenThens(List<SQLCaseWhenThen> whenThens)
      Set the when clauses
    • getElseExpression

      public SQLExpression getElseExpression()
      Get the else expression
    • setElseExpression

      public void setElseExpression(SQLExpression elseExpression)
      Set the else expression
    • isBoolean

      public boolean isBoolean(QoQSelectExecution QoQExec)
      Runtime check if the expression evaluates to a boolean value and works for columns as well
      Overrides:
      isBoolean in class SQLExpression
      Parameters:
      QoQExec - Query execution state
      Returns:
      true if the expression evaluates to a boolean value
    • isNumeric

      public boolean isNumeric(QoQSelectExecution QoQExec)
      Runtime check if the expression evaluates to a numeric value and works for columns as well
      Overrides:
      isNumeric in class SQLExpression
      Parameters:
      QoQExec - Query execution state
      Returns:
      true if the expression evaluates to a numeric value
    • getType

      public QueryColumnType getType(QoQSelectExecution QoQExec)
      What type does this expression evaluate to
      Overrides:
      getType in class SQLExpression
    • evaluate

      public Object evaluate(QoQSelectExecution QoQExec, int[] intersection)
      Evaluate the expression
      Specified by:
      evaluate in class SQLExpression
    • evaluateAggregate

      public Object evaluateAggregate(QoQSelectExecution QoQExec, List<int[]> intersections)
      Evaluate the expression aginst a partition of data
      Specified by:
      evaluateAggregate in class SQLExpression
    • accept

      public void accept(VoidBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for visitor support.
      Parameters:
      v - the visitor implementation
    • accept

      public BoxNode accept(ReplacingBoxVisitor v)
      Description copied from interface: BoxVisitable
      Accept method for replacing visitor support. Each accept returns the node, or a replacement node.
      Parameters:
      v - the visitor implementation
    • toMap

      public Map<String,Object> toMap()
      Overrides:
      toMap in class BoxNode