Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.compile
Class SQLBooleanConstantNode  view SQLBooleanConstantNode download SQLBooleanConstantNode.java

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.ConstantNode
              extended byorg.apache.derby.impl.sql.compile.SQLBooleanConstantNode
All Implemented Interfaces:
org.apache.derby.iapi.sql.compile.Visitable

public class SQLBooleanConstantNode
extends ConstantNode


Field Summary
protected  org.apache.derby.iapi.types.DataValueDescriptor value
           
 
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
SQLBooleanConstantNode()
           
 
Method Summary
 ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Bind this expression.
 boolean constantExpression(PredicateList whereClause)
          Return whether or not this expression tree represents a constant value.
(package private)  void generateConstant(ExpressionClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb)
          This generates the proper constant.
 void generateExpression(ExpressionClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb)
          For a ConstantNode, we generate the equivalent literal value.
 ValueNode getClone()
          Return a clone of this node.
protected  int getOrderableVariantType()
          Return the variant type for the underlying expression.
 org.apache.derby.iapi.types.DataValueDescriptor getValue()
          Get the value in this ConstantNode
 void init(java.lang.Object newValue)
          Initializer for a SQLBooleanConstantNode.
 void init(java.lang.Object typeId, java.lang.Object nullable, java.lang.Object maximumWidth)
          Initializer for non-numeric types
 boolean isCloneable()
          Return whether or not this expression tree is cloneable.
 boolean isConstantExpression()
          Return whether or not this expression tree represents a constant expression.
 boolean isNull()
          Return whether or not this node represents a typed null constant.
(package private)  void setValue(org.apache.derby.iapi.types.DataValueDescriptor value)
          Set the value in this ConstantNode.
 java.lang.String toString()
          Convert this object to a String.
 
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, categorize, changeToCNF, checkIsBoolean, checkReliability, checkReliability, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClause, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isParameterNode, isRelationalOperator, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, selectivity, setClause, setDescriptor, setTransformed, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
accept, 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, printSubNodes, referencesSessionSchema, resolveTableToSynonym, 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

value

protected org.apache.derby.iapi.types.DataValueDescriptor value
Constructor Detail

SQLBooleanConstantNode

public SQLBooleanConstantNode()
Method Detail

init

public void init(java.lang.Object newValue)
          throws org.apache.derby.iapi.error.StandardException
Initializer for a SQLBooleanConstantNode.

Overrides:
init in class QueryTreeNode

generateConstant

void generateConstant(ExpressionClassBuilder acb,
                      org.apache.derby.iapi.services.compiler.MethodBuilder mb)
                throws org.apache.derby.iapi.error.StandardException
This generates the proper constant. It is implemented by every specific constant node (e.g. IntConstantNode).

Specified by:
generateConstant in class ConstantNode

init

public void init(java.lang.Object typeId,
                 java.lang.Object nullable,
                 java.lang.Object maximumWidth)
          throws org.apache.derby.iapi.error.StandardException
Initializer for non-numeric types

Overrides:
init in class QueryTreeNode

setValue

void setValue(org.apache.derby.iapi.types.DataValueDescriptor value)
Set the value in this ConstantNode.


getValue

public org.apache.derby.iapi.types.DataValueDescriptor getValue()
Get the value in this ConstantNode


toString

public java.lang.String toString()
Convert this object to a String. See comments in QueryTreeNode.java for how this should be done for tree printing.

Overrides:
toString in class ValueNode

isCloneable

public boolean isCloneable()
Return whether or not this expression tree is cloneable.

Overrides:
isCloneable in class ValueNode

getClone

public ValueNode getClone()
Return a clone of this node.

Overrides:
getClone in class ValueNode

bindExpression

public ValueNode bindExpression(FromList fromList,
                                SubqueryList subqueryList,
                                java.util.Vector aggregateVector)
Bind this expression. This means binding the sub-expressions, as well as figuring out what the return type is for this expression. In this case, there are no sub-expressions, and the return type is already known, so this is just a stub.

Overrides:
bindExpression in class ValueNode

isConstantExpression

public boolean isConstantExpression()
Return whether or not this expression tree represents a constant expression.

Overrides:
isConstantExpression in class ValueNode

constantExpression

public boolean constantExpression(PredicateList whereClause)
Description copied from class: ValueNode
Return whether or not this expression tree represents a constant value. In this case, "constant" means that it will always evaluate to the same thing, even if it includes columns. A column is constant if it is compared to a constant expression.

Overrides:
constantExpression in class ValueNode

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               org.apache.derby.iapi.services.compiler.MethodBuilder mb)
                        throws org.apache.derby.iapi.error.StandardException
For a ConstantNode, we generate the equivalent literal value. A null is generated as a Null value cast to the type of the constant node. The subtypes of ConstantNode generate literal expressions for non-null values.

Overrides:
generateExpression in class ValueNode

isNull

public boolean isNull()
Return whether or not this node represents a typed null constant.


getOrderableVariantType

protected int getOrderableVariantType()
Return the variant type for the underlying expression. The variant type can be: VARIANT - variant within a scan (method calls and non-static field access) SCAN_INVARIANT - invariant within a scan (column references from outer tables) QUERY_INVARIANT - invariant within the life of a query VARIANT - immutable

Overrides:
getOrderableVariantType in class ValueNode