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

public final Class CharConstantNode

extends ConstantNode
Class Inheritance
Imports
java.util.List, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.compiler.MethodBuilder, org.apache.derby.iapi.services.context.ContextManager, org.apache.derby.iapi.types.StringDataValue, .TypeId

Field Summary

Modifier and TypeField and Description
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv static final int
pack-priv final int
kind

This class is used to hold logically different objects for space efficiency.

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

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
pack-priv
CharConstantNode(int
The node kind
kind
,
TypeId
The type id
t
,
ContextManager
The context manager
cm
)

pack-priv
CharConstantNode(String
A String containing the value of the constant
newValue
,
int
The length of the new value of the constant
newLength
,
ContextManager cm)

Constructor for a CharConstantNode of a specific length.

Method Summary

Modifier and TypeMethod and Description
pack-priv ValueNode
bindExpression(FromList
The FROM list for the query this expression is in, for binding columns.
fromList
,
SubqueryList
The subquery list being built as we find SubqueryNodes
subqueryList
,
List<AggregateNode>
The aggregate list being built as we find AggregateNodes
aggregates
)

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

Bind this expression.

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 of this CharConstantNode.
getString
()

Return the value from this CharConstantNode

pack-priv boolean
isSameNodeKind(ValueNode
The other value node whose kind we want to compare with.
o
)

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

Some node classes represent several logical node types (to reduce footprint), which we call kinds.

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

Field Detail

K_CHARback to summary
pack-priv static final int K_CHAR
K_CLOBback to summary
pack-priv static final int K_CLOB
K_LONGVARCHARback to summary
pack-priv static final int K_LONGVARCHAR
K_VARCHARback to summary
pack-priv static final int K_VARCHAR
kindback to summary
pack-priv final int kind

This class is used to hold logically different objects for space efficiency. kind represents the logical object type. See also ValueNode#isSameNodeKind.

Constructor Detail

CharConstantNodeback to summary
pack-priv CharConstantNode(String value, ContextManager cm) throws StandardException
CharConstantNodeback to summary
pack-priv CharConstantNode(TypeId t, ContextManager cm) throws StandardException
CharConstantNodeback to summary
pack-priv CharConstantNode(int kind, TypeId t, ContextManager cm) throws StandardException
Parameters
kind:int

The node kind

t:TypeId

The type id

cm:ContextManager

The context manager

CharConstantNodeback to summary
pack-priv CharConstantNode(String newValue, int newLength, ContextManager cm) throws StandardException

Constructor for a CharConstantNode of a specific length.

Parameters
newValue:String

A String containing the value of the constant

newLength:int

The length of the new value of the constant

Method Detail

bindExpressionback to summary
pack-priv ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates) throws StandardException

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

Doc from org.apache.derby.impl.sql.compile.ConstantNode.bindExpression.

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.

Parameters
fromList:FromList

The FROM list for the query this expression is in, for binding columns.

subqueryList:SubqueryList

The subquery list being built as we find SubqueryNodes

aggregates:List<AggregateNode>

The aggregate list being built as we find AggregateNodes

Returns:ValueNode

The new top of the expression tree.

Annotations
@Override
Exceptions
StandardException:
Thrown on error. Although this class doesn't throw this exception, it's subclasses do and hence this method signature here needs to have throws StandardException
generateConstantback to summary
pack-priv void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException

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

Exceptions
StandardException:
Thrown on error
getConstantValueAsObjectback to summary
pack-priv Object getConstantValueAsObject() throws StandardException

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
Exceptions
StandardException:
Thrown on error
getStringback to summary
pack-priv String getString() throws StandardException

Return the value from this CharConstantNode

Returns:String

The value of this CharConstantNode.

Exceptions
StandardException:
Thrown on error
isSameNodeKindback to summary
pack-priv boolean isSameNodeKind(ValueNode o)

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

Doc from org.apache.derby.impl.sql.compile.ValueNode.isSameNodeKind.

Some node classes represent several logical node types (to reduce footprint), which we call kinds. This means that implementations of isEquivalent cannot always just use instanceof to check if the other node represents the same kind. Hence this method needs to be overridden by all node classes that represent several kinds. This default implementation does not look at kinds. It is only called from implementations of isEquivalent.

Parameters
o:ValueNode

The other value node whose kind we want to compare with.

Returns:boolean

true if this and o represent the same logical node type, i.e. kind.

Annotations
@Override