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

java.lang.Object
  extended by org.apache.derby.impl.sql.compile.QueryTreeNode
      extended by org.apache.derby.impl.sql.compile.ValueNode
          extended by org.apache.derby.impl.sql.compile.ConstantNode
              extended by org.apache.derby.impl.sql.compile.BooleanConstantNode
All Implemented Interfaces:
Visitable

public final class BooleanConstantNode
extends ConstantNode


Field Summary
(package private)  boolean booleanValue
           
(package private)  boolean unknownValue
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.ConstantNode
value
 
Fields inherited from class org.apache.derby.impl.sql.compile.ValueNode
transformed
 
Fields inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX, isPrivilegeCollectionRequired
 
Constructor Summary
BooleanConstantNode()
           
 
Method Summary
(package private)  ValueNode eliminateNots(boolean underNotNode)
          Eliminate NotNodes in the current query block.
(package private)  void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb)
          This generates the proper constant.
(package private)  java.lang.Object getConstantValueAsObject()
          Return an Object representing the bind time value of this expression tree.
(package private)  java.lang.String getValueAsString()
          Return the value as a string.
 void init(java.lang.Object arg1)
          Initializer for a BooleanConstantNode.
(package private)  boolean isBooleanFalse()
          Does this represent a false constant.
(package private)  boolean isBooleanTrue()
          Does this represent a true constant.
 double selectivity(Optimizable optTable)
          The default selectivity for value nodes is 50%.
 void setValue(DataValueDescriptor value)
          Set the value in this ConstantNode.
 
Methods inherited from class org.apache.derby.impl.sql.compile.ConstantNode
bindExpression, constantExpression, generateExpression, getClone, getOrderableVariantType, getValue, init, isCloneable, isConstantExpression, isEquivalent, isNull, toString
 
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, categorize, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, evaluateConstantExpressions, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getColumnName, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isInListProbeNode, isParameterNode, isRelationalOperator, isSameNodeType, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, requiresTypeFromContext, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, acceptChildren, bindOffsetFetch, bindRowMultiSet, bindUserType, checkReliability, checkReliability, convertDefaultNode, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, foundString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, orReliability, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, stackPrint, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

booleanValue

boolean booleanValue

unknownValue

boolean unknownValue
Constructor Detail

BooleanConstantNode

public BooleanConstantNode()
Method Detail

init

public void init(java.lang.Object arg1)
          throws StandardException
Initializer for a BooleanConstantNode.

Overrides:
init in class QueryTreeNode
Parameters:
arg1 - A boolean containing the value of the constant OR The TypeId for the type of the node
Throws:
StandardException

getConstantValueAsObject

java.lang.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

java.lang.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

public void setValue(DataValueDescriptor value)
Set the value in this ConstantNode.

Overrides:
setValue in class ConstantNode

Built on Thu 2011-03-10 11:54:14+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.