|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
org.apache.derby.impl.sql.compile
Class BooleanConstantNode

java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.ConstantNode
org.apache.derby.impl.sql.compile.BooleanConstantNode
- All Implemented Interfaces:
- org.apache.derby.iapi.sql.compile.Visitable
- public final class BooleanConstantNode
- extends ConstantNode
| Field Summary | |
(package private) boolean |
booleanValue
|
(package private) boolean |
unknownValue
|
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 | |
BooleanConstantNode()
|
|
| 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) ValueNode |
eliminateNots(boolean underNotNode)
Eliminate NotNodes in the current query block. |
(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. |
(package private) java.lang.Object |
getConstantValueAsObject()
Return an Object representing the bind time value of this expression tree. |
protected int |
getOrderableVariantType()
Return the variant type for the underlying expression. |
org.apache.derby.iapi.types.DataValueDescriptor |
getValue()
Get the value in this ConstantNode |
(package private) java.lang.String |
getValueAsString()
Return the value as a string. |
void |
init(java.lang.Object arg1)
Initializer for a BooleanConstantNode. |
void |
init(java.lang.Object typeId,
java.lang.Object nullable,
java.lang.Object maximumWidth)
Initializer for non-numeric types |
(package private) boolean |
isBooleanFalse()
Does this represent a false constant. |
(package private) boolean |
isBooleanTrue()
Does this represent a true constant. |
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. |
double |
selectivity(org.apache.derby.iapi.sql.compile.Optimizable optTable)
The default selectivity for value nodes is 50%. |
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
booleanValue
boolean booleanValue
unknownValue
boolean unknownValue
value
protected org.apache.derby.iapi.types.DataValueDescriptor value
| Constructor Detail |
BooleanConstantNode
public BooleanConstantNode()
| Method Detail |
init
public void init(java.lang.Object arg1) throws org.apache.derby.iapi.error.StandardException
- Initializer for a BooleanConstantNode.
- Overrides:
initin classQueryTreeNode
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:
getConstantValueAsObjectin classValueNode
getValueAsString
java.lang.String getValueAsString()
- Return the value as a string.
isBooleanTrue
boolean isBooleanTrue()
- Does this represent a true constant.
- Overrides:
isBooleanTruein classValueNode
isBooleanFalse
boolean isBooleanFalse()
- Does this represent a false constant.
- Overrides:
isBooleanFalsein classValueNode
selectivity
public double selectivity(org.apache.derby.iapi.sql.compile.Optimizable optTable)
- The default selectivity for value nodes is 50%. This is overridden
in specific cases, such as the RelationalOperators.
- Overrides:
selectivityin classValueNode
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:
eliminateNotsin classValueNode
generateConstant
void generateConstant(ExpressionClassBuilder acb, org.apache.derby.iapi.services.compiler.MethodBuilder mb)
- This generates the proper constant. It is implemented
by every specific constant node (e.g. IntConstantNode).
- Specified by:
generateConstantin classConstantNode
setValue
public void setValue(org.apache.derby.iapi.types.DataValueDescriptor value)
- Set the value in this ConstantNode.
- Overrides:
setValuein classConstantNode
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:
initin classQueryTreeNode
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.
isCloneable
public boolean isCloneable()
- Return whether or not this expression tree is cloneable.
- Overrides:
isCloneablein classValueNode
getClone
public ValueNode getClone()
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:
bindExpressionin classValueNode
isConstantExpression
public boolean isConstantExpression()
- Return whether or not this expression tree represents a constant expression.
- Overrides:
isConstantExpressionin classValueNode
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:
constantExpressionin classValueNode
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:
generateExpressionin classValueNode
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:
getOrderableVariantTypein classValueNode
|
|||||||||
| Home >> All >> org >> apache >> derby >> impl >> sql >> [ compile overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC