Class BetweenOperatorNode

All Implemented Interfaces:
Visitable

class BetweenOperatorNode extends BinaryListOperatorNode
A BetweenOperatorNode represents a BETWEEN clause. The between values are represented as a 2 element list in order to take advantage of code reuse.
  • Constructor Details

  • Method Details

    • vetValues

      private static ValueNodeList vetValues(ValueNodeList betweenValues)
    • eliminateNots

      ValueNode eliminateNots(boolean underNotNode) throws StandardException
      Eliminate NotNodes in the current query block. We traverse the tree, inverting ANDs and ORs and eliminating NOTs as we go. We stop at ComparisonOperators and boolean expressions. We invert ComparisonOperators and replace boolean expressions with boolean expression = false. NOTE: Since we do not recurse under ComparisonOperators, there still could be NotNodes left in the tree.
      Overrides:
      eliminateNots in class ValueNode
      Parameters:
      underNotNode - Whether or not we are under a NotNode.
      Returns:
      The modified expression
      Throws:
      StandardException - Thrown on error
    • preprocess

      ValueNode preprocess(int numTables, FromList outerFromList, SubqueryList outerSubqueryList, PredicateList outerPredicateList) throws StandardException
      Preprocess an expression tree. We do a number of transformations here (including subqueries, IN lists, LIKE and BETWEEN) plus subquery flattening. NOTE: This is done before the outer ResultSetNode is preprocessed.
      Overrides:
      preprocess in class BinaryListOperatorNode
      Parameters:
      numTables - Number of tables in the DML Statement
      outerFromList - FromList from outer query block
      outerSubqueryList - SubqueryList from outer query block
      outerPredicateList - PredicateList from outer query block
      Returns:
      The modified expression
      Throws:
      StandardException - Thrown on error
    • generateExpression

      void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
      Do code generation for this BETWEEN operator.
      Overrides:
      generateExpression in class ValueNode
      Parameters:
      acb - The ExpressionClassBuilder for the class we're generating
      mb - The method the code to place the code
      Throws:
      StandardException - Thrown on error