Class NotNode

All Implemented Interfaces:
Visitable

public final class NotNode extends UnaryLogicalOperatorNode
A NotNode represents a NOT operator. Preprocessing will eliminate the NotNodes which exist above comparison operators so that the optimizer will see a query tree in CNF.
  • Constructor Details

  • Method Details

    • 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.
      Overrides:
      eliminateNots in class ValueNode
      Parameters:
      underNotNode - Whether or not we are under a NotNode.
      Returns:
      The modified expression
      Throws:
      StandardException - Thrown on error
    • generateExpression

      void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
      Do code generation for the NOT operator.
      Overrides:
      generateExpression in class UnaryOperatorNode
      Parameters:
      acb - The ExpressionClassBuilder for the class we're generating
      mb - The method the expression will go into
      Throws:
      StandardException - Thrown on error