org.apache.derby.impl.sql.compile
Class BinaryLogicalOperatorNode

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.ValueNode
          extended byorg.apache.derby.impl.sql.compile.BinaryOperatorNode
              extended byorg.apache.derby.impl.sql.compile.BinaryLogicalOperatorNode
All Implemented Interfaces:
Visitable
Direct Known Subclasses:
AndNode, IsNode, OrNode

public abstract class BinaryLogicalOperatorNode
extends BinaryOperatorNode


Field Summary
(package private)  boolean shortCircuitValue
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.BinaryOperatorNode
AND, CONCATENATE, DIVIDE, EQ, GE, GT, LE, leftInterfaceType, leftOperand, LIKE, LT, methodName, MINUS, NE, operator, OR, PLUS, receiver, rightInterfaceType, rightOperand, TIMES
 
Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode
clause, dataTypeServices, IN_HAVING_CLAUSE, IN_SELECT_LIST, IN_UNKNOWN_CLAUSE, IN_WHERE_CLAUSE, transformed
 
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, beginOffset, endOffset
 
Constructor Summary
BinaryLogicalOperatorNode()
           
 
Method Summary
 ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Bind this logical operator.
 void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
          Do code generation for this logical binary operator.
 void init(java.lang.Object leftOperand, java.lang.Object rightOperand, java.lang.Object shortCircuitValue, java.lang.Object methodName)
          Initializer for a BinaryLogicalOperatorNode
(package private)  DataTypeDescriptor resolveLogicalBinaryOperator(DataTypeDescriptor leftType, DataTypeDescriptor rightType)
           
(package private)  boolean verifyEliminateNots()
          Verify that eliminateNots() did its job correctly.
 
Methods inherited from class org.apache.derby.impl.sql.compile.BinaryOperatorNode
accept, categorize, constantExpression, genSQLJavaSQLTree, getLeftOperand, getOrderableVariantType, getReceiverInterfaceName, getRightOperand, init, initializeResultField, isConstantExpression, preprocess, printSubNodes, remapColumnReferencesToExpressions, setClause, setLeftOperand, setLeftRightInterfaceType, setMethodName, setOperator, setRightOperand, swapOperands, toString
 
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, changeToCNF, checkIsBoolean, checkReliability, checkReliability, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, genEqualsFalseTree, generate, generateFilter, genIsNullTree, getClause, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, selectivity, setDescriptor, setTransformed, setType, verifyChangeToCNF, verifyPutAndsOnTop
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

shortCircuitValue

boolean shortCircuitValue
Constructor Detail

BinaryLogicalOperatorNode

public BinaryLogicalOperatorNode()
Method Detail

init

public void init(java.lang.Object leftOperand,
                 java.lang.Object rightOperand,
                 java.lang.Object shortCircuitValue,
                 java.lang.Object methodName)
Initializer for a BinaryLogicalOperatorNode

Overrides:
init in class BinaryOperatorNode
Parameters:
leftOperand - The left operand of the comparison
rightOperand - The right operand of the comparison
shortCircuitValue - The value which, if found on the left, means we don't have to evaluate the right.
methodName - The name of the method to call in the generated class. In this case, it's actually an operator name.

bindExpression

public ValueNode bindExpression(FromList fromList,
                                SubqueryList subqueryList,
                                java.util.Vector aggregateVector)
                         throws StandardException
Bind this logical operator. All that has to be done for binding a logical operator is to bind the operands, check that both operands are BooleanDataValue, and set the result type to BooleanDataValue.

Overrides:
bindExpression in class BinaryOperatorNode
Parameters:
fromList - The query's FROM list
subqueryList - The subquery list being built as we find SubqueryNodes
aggregateVector - The aggregate vector being built as we find AggregateNodes
Returns:
The new top of the expression tree.
Throws:
StandardException - Thrown on error

verifyEliminateNots

boolean verifyEliminateNots()
Verify that eliminateNots() did its job correctly. Verify that there are no NotNodes above the top level comparison operators and boolean expressions.

Overrides:
verifyEliminateNots in class ValueNode
Returns:
Boolean which reflects validity of the tree.

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               MethodBuilder mb)
                        throws StandardException
Do code generation for this logical binary operator.

Overrides:
generateExpression in class BinaryOperatorNode
Parameters:
acb - The ExpressionClassBuilder for the class we're generating
mb - The method the code to place the code
Throws:
StandardException - Thrown on error

resolveLogicalBinaryOperator

DataTypeDescriptor resolveLogicalBinaryOperator(DataTypeDescriptor leftType,
                                                DataTypeDescriptor rightType)
                                          throws StandardException
Throws:
StandardException


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.