Top Fields Constructors Methods
org.apache.derby.impl.sql.compile

public final Class BooleanConstantNode

extends ConstantNode
Class Inheritance
Imports
org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.compile.Optimizable, org.apache.derby.iapi.types.SQLBoolean, .DataValueDescriptor, .TypeId, org.apache.derby.iapi.services.context.ContextManager

Field Summary

Modifier and TypeField and Description
pack-priv boolean
pack-priv boolean
Inherited from org.apache.derby.impl.sql.compile.ConstantNode:
value

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv ValueNode

Returns:

The modified expression
eliminateNots
(boolean
Whether or not we are under a NotNode.
underNotNode
)

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

Eliminate NotNodes in the current query block.

pack-priv void
generateConstant(ExpressionClassBuilder
The ExpressionClassBuilder for the class being built
acb
,
MethodBuilder
The method the code to place the code
mb
)

Implements abstract org.apache.derby.impl.sql.compile.ConstantNode.generateConstant.

This generates the proper constant.

pack-priv Object

Returns:

An Object representing the bind time value of this expression tree. (null if not a bind time constant.)
getConstantValueAsObject
()

Overrides org.apache.derby.impl.sql.compile.ValueNode.getConstantValueAsObject.

Return an Object representing the bind time value of this expression tree.

pack-priv String

Returns:

The value as a string.
getValueAsString
()

Return the value as a string.

pack-priv boolean

Returns:

Whether or not this node represents a false constant.
isBooleanFalse
()

Overrides org.apache.derby.impl.sql.compile.ValueNode.isBooleanFalse.

Does this represent a false constant.

pack-priv boolean

Returns:

Whether or not this node represents a true constant.
isBooleanTrue
()

Overrides org.apache.derby.impl.sql.compile.ValueNode.isBooleanTrue.

Does this represent a true constant.

public double
selectivity(Optimizable optTable)

Overrides org.apache.derby.impl.sql.compile.ValueNode.selectivity.

The default selectivity for value nodes is 50%.

pack-priv void
setValue(DataValueDescriptor value)

Overrides org.apache.derby.impl.sql.compile.ConstantNode.setValue.

Set the value in this ConstantNode.

Inherited from org.apache.derby.impl.sql.compile.ConstantNode:
bindExpressionconstantExpressiongenerateExpressiongetClonegetOrderableVariantTypegetValueisCloneableisConstantExpressionisEquivalentisNulltoString

Field Detail

booleanValueback to summary
pack-priv boolean booleanValue
unknownValueback to summary
pack-priv boolean unknownValue

Constructor Detail

BooleanConstantNodeback to summary
pack-priv BooleanConstantNode(ContextManager cm) throws StandardException
Parameters
cm:ContextManager

context manager

BooleanConstantNodeback to summary
pack-priv BooleanConstantNode(boolean value, ContextManager cm) throws StandardException
BooleanConstantNodeback to summary
pack-priv BooleanConstantNode(TypeId t, ContextManager cm) throws StandardException

Method Detail

eliminateNotsback to summary
pack-priv ValueNode eliminateNots(boolean underNotNode)

Overrides org.apache.derby.impl.sql.compile.ValueNode.eliminateNots.

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.

Parameters
underNotNode:boolean

Whether or not we are under a NotNode.

Returns:ValueNode

The modified expression

Annotations
@Override
generateConstantback to summary
pack-priv void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb)

Implements abstract org.apache.derby.impl.sql.compile.ConstantNode.generateConstant.

This generates the proper constant. It is implemented by every specific constant node (e.g. IntConstantNode).

Parameters
acb:ExpressionClassBuilder

The ExpressionClassBuilder for the class being built

mb:MethodBuilder

The method the code to place the code

getConstantValueAsObjectback to summary
pack-priv Object getConstantValueAsObject()

Overrides org.apache.derby.impl.sql.compile.ValueNode.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?

Returns:Object

An Object representing the bind time value of this expression tree. (null if not a bind time constant.)

Annotations
@Override
getValueAsStringback to summary
pack-priv String getValueAsString()

Return the value as a string.

Returns:String

The value as a string.

isBooleanFalseback to summary
pack-priv boolean isBooleanFalse()

Overrides org.apache.derby.impl.sql.compile.ValueNode.isBooleanFalse.

Does this represent a false constant.

Returns:boolean

Whether or not this node represents a false constant.

Annotations
@Override
isBooleanTrueback to summary
pack-priv boolean isBooleanTrue()

Overrides org.apache.derby.impl.sql.compile.ValueNode.isBooleanTrue.

Does this represent a true constant.

Returns:boolean

Whether or not this node represents a true constant.

Annotations
@Override
selectivityback to summary
public double selectivity(Optimizable optTable)

Overrides org.apache.derby.impl.sql.compile.ValueNode.selectivity.

The default selectivity for value nodes is 50%. This is overridden in specific cases, such as the RelationalOperators.

Annotations
@Override
setValueback to summary
pack-priv void setValue(DataValueDescriptor value)

Overrides org.apache.derby.impl.sql.compile.ConstantNode.setValue.

Set the value in this ConstantNode.

Annotations
@Override