Class BooleanConstantNode

All Implemented Interfaces:
Visitable

public final class BooleanConstantNode extends ConstantNode
  • Field Details

    • booleanValue

      boolean booleanValue
    • unknownValue

      boolean unknownValue
  • Constructor Details

  • Method Details

    • getConstantValueAsObject

      Object getConstantValueAsObject()
      Return an Object representing the bind time value of this expression tree. If the expression tree does not evaluate to a constant at bind time then we return null. This is useful for bind time resolution of VTIs. RESOLVE: What do we do for primitives?
      Overrides:
      getConstantValueAsObject in class ValueNode
      Returns:
      An Object representing the bind time value of this expression tree. (null if not a bind time constant.)
    • getValueAsString

      String getValueAsString()
      Return the value as a string.
      Returns:
      The value as a string.
    • isBooleanTrue

      boolean isBooleanTrue()
      Does this represent a true constant.
      Overrides:
      isBooleanTrue in class ValueNode
      Returns:
      Whether or not this node represents a true constant.
    • isBooleanFalse

      boolean isBooleanFalse()
      Does this represent a false constant.
      Overrides:
      isBooleanFalse in class ValueNode
      Returns:
      Whether or not this node represents a false constant.
    • selectivity

      public double selectivity(Optimizable optTable)
      The default selectivity for value nodes is 50%. This is overridden in specific cases, such as the RelationalOperators.
      Overrides:
      selectivity in class ValueNode
    • eliminateNots

      ValueNode eliminateNots(boolean underNotNode)
      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
    • generateConstant

      void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb)
      This generates the proper constant. It is implemented by every specific constant node (e.g. IntConstantNode).
      Specified by:
      generateConstant in class ConstantNode
      Parameters:
      acb - The ExpressionClassBuilder for the class being built
      mb - The method the code to place the code
    • setValue

      void setValue(DataValueDescriptor value)
      Set the value in this ConstantNode.
      Overrides:
      setValue in class ConstantNode