Class CharConstantNode
- java.lang.Object
-
- org.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.CharConstantNode
-
- All Implemented Interfaces:
Visitable
public final class CharConstantNode extends ConstantNode
-
-
Field Summary
Fields Modifier and Type Field Description (package private) static int
K_CHAR
(package private) static int
K_CLOB
(package private) static int
K_LONGVARCHAR
(package private) static int
K_VARCHAR
(package private) int
kind
This class is used to hold logically different objects for space efficiency.-
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_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
-
-
Constructor Summary
Constructors Constructor Description CharConstantNode(int kind, TypeId t, ContextManager cm)
CharConstantNode(java.lang.String newValue, int newLength, ContextManager cm)
Constructor for a CharConstantNode of a specific length.CharConstantNode(java.lang.String value, ContextManager cm)
CharConstantNode(TypeId t, ContextManager cm)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) ValueNode
bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates)
Bind this expression.(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
getString()
Return the value from this CharConstantNode(package private) boolean
isSameNodeKind(ValueNode o)
Some node classes represent several logical node types (to reduce footprint), which we call kinds.-
Methods inherited from class org.apache.derby.impl.sql.compile.ConstantNode
constantExpression, generateExpression, getClone, getOrderableVariantType, getValue, isCloneable, isConstantExpression, isEquivalent, isNull, setValue, toString
-
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, categorize, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getColumnName, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isInListProbeNode, isParameterNode, isRelationalOperator, optimizableEqualityNode, preprocess, putAndsOnTop, remapColumnReferencesToExpressions, requiresTypeFromContext, selectivity, 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, addTag, addUDTUsagePriv, addUDTUsagePriv, bindOffsetFetch, bindRowMultiSet, bindUserCatalogType, bindUserType, checkReliability, checkReliability, convertDefaultNode, copyTagsFrom, createTypeDependency, debugFlush, debugPrint, disablePrivilegeCollection, formatNodeString, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContext, getContextManager, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getLongProperty, getNullNode, getOffsetOrderedNodes, getOptimizerFactory, getOptimizerTracer, getParameterTypes, getSchemaDescriptor, getSchemaDescriptor, getStatementType, getTableDescriptor, getTypeCompiler, getUDTDesc, isAtomic, isPrivilegeCollectionRequired, isSessionSchema, isSessionSchema, makeConstantAction, makeTableName, makeTableName, nodeHeader, optimizerTracingIsOn, orReliability, parseSearchCondition, parseStatement, printLabel, printSubNodes, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
-
-
-
-
Field Detail
-
K_CHAR
static final int K_CHAR
- See Also:
- Constant Field Values
-
K_VARCHAR
static final int K_VARCHAR
- See Also:
- Constant Field Values
-
K_LONGVARCHAR
static final int K_LONGVARCHAR
- See Also:
- Constant Field Values
-
K_CLOB
static final int K_CLOB
- See Also:
- Constant Field Values
-
kind
final int kind
This class is used to hold logically different objects for space efficiency.kind
represents the logical object type. See alsoValueNode.isSameNodeKind(org.apache.derby.impl.sql.compile.ValueNode)
.
-
-
Constructor Detail
-
CharConstantNode
CharConstantNode(java.lang.String value, ContextManager cm) throws StandardException
- Throws:
StandardException
-
CharConstantNode
CharConstantNode(TypeId t, ContextManager cm) throws StandardException
- Throws:
StandardException
-
CharConstantNode
CharConstantNode(int kind, TypeId t, ContextManager cm) throws StandardException
- Parameters:
kind
- The node kindt
- The type idcm
- The context manager- Throws:
StandardException
-
CharConstantNode
CharConstantNode(java.lang.String newValue, int newLength, ContextManager cm) throws StandardException
Constructor for a CharConstantNode of a specific length.- Parameters:
newValue
- A String containing the value of the constantnewLength
- The length of the new value of the constantcm
-- Throws:
StandardException
-
-
Method Detail
-
getString
java.lang.String getString() throws StandardException
Return the value from this CharConstantNode- Returns:
- The value of this CharConstantNode.
- Throws:
StandardException
- Thrown on error
-
getConstantValueAsObject
java.lang.Object getConstantValueAsObject() throws StandardException
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 classValueNode
- Returns:
- An Object representing the bind time value of this expression tree. (null if not a bind time constant.)
- Throws:
StandardException
- Thrown on error
-
bindExpression
ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
Description copied from class:ConstantNode
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 classConstantNode
- Parameters:
fromList
- The FROM list for the query this expression is in, for binding columns.subqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodes- Returns:
- The new top of the expression tree.
- Throws:
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
-
generateConstant
void generateConstant(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
This generates the proper constant. It is implemented by every specific constant node (e.g. IntConstantNode).- Specified by:
generateConstant
in classConstantNode
- Parameters:
acb
- The ExpressionClassBuilder for the class being builtmb
- The method the code to place the code- Throws:
StandardException
- Thrown on error
-
isSameNodeKind
boolean isSameNodeKind(ValueNode o)
Description copied from class:ValueNode
Some node classes represent several logical node types (to reduce footprint), which we call kinds. This means that implementations ofValueNode.isEquivalent(org.apache.derby.impl.sql.compile.ValueNode)
cannot always just useinstanceof
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 ofisEquivalent
.- Overrides:
isSameNodeKind
in classValueNode
- Parameters:
o
- The other value node whose kind we want to compare with.- Returns:
true
ifthis
ando
represent the same logical node type, i.e. kind.
-
-