class UnaryArithmeticOperatorNode extends UnaryOperatorNode
Modifier and Type | Field and Description |
---|---|
(package private) static int |
K_ABS |
(package private) static int |
K_MINUS |
(package private) static int |
K_PLUS |
(package private) static int |
K_SQRT |
(package private) int |
kind
This class is used to hold logically different objects for
space efficiency.
|
private static java.lang.String[] |
UNARY_METHODS |
private static java.lang.String[] |
UNARY_OPERATORS |
K_BASE, K_XMLPARSE, K_XMLSERIALIZE, methodName, operand, operator, receiverInterfaceType, resultInterfaceType, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes
transformed
AUTOINCREMENT_CREATE_MODIFY, AUTOINCREMENT_CYCLE, AUTOINCREMENT_INC_INDEX, AUTOINCREMENT_IS_AUTOINCREMENT_INDEX, AUTOINCREMENT_START_INDEX
Constructor and Description |
---|
UnaryArithmeticOperatorNode(ValueNode operand,
int kind,
ContextManager cm) |
Modifier and Type | Method and Description |
---|---|
(package private) ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.List<AggregateNode> aggregates)
Bind this operator
|
(package private) void |
bindParameter()
For SQRT and ABS the parameter becomes a DOUBLE.
|
private void |
bindSQRTABS()
Bind SQRT or ABS
|
private void |
checkOperandIsNumeric(TypeId operandType)
Only called for Unary +/-.
|
(package private) void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
Do code generation for this unary plus operator
|
boolean |
isParameterNode()
A +?
|
(package private) boolean |
isSameNodeKind(ValueNode o)
Some node classes represent several logical node types (to reduce
footprint), which we call kinds.
|
boolean |
requiresTypeFromContext()
Unary + and - require their type to be set if
they wrap another node (e.g. a parameter) that
requires type from its context.
|
(package private) void |
setType(DataTypeDescriptor descriptor)
We are overwriting this method here because for -?
|
acceptChildren, addXmlOpMethodParams, bindOperand, categorize, constantExpression, getOperand, getOperatorString, getOrderableVariantType, getParameterOperand, getReceiverInterfaceName, isConstantExpression, isEquivalent, preprocess, printSubNodes, remapColumnReferencesToExpressions, setMethodName, setOperator, toString
pushSqlXmlUtil
bindExpression, changeToCNF, checkIsBoolean, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, evaluateConstantExpressions, genEqualsFalseTree, generate, genIsNullTree, genSQLJavaSQLTree, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isInListProbeNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, selectivity, setCollationInfo, setCollationInfo, setCollationUsingCompilationSchema, setCollationUsingCompilationSchema, setNullability, setTransformed, setType, setType, updatableByCursor, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
accept, 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, referencesSessionSchema, resolveTableToSynonym, setBeginOffset, setEndOffset, setRefActionInfo, stackPrint, taggedWith, treePrint, treePrint, verifyClassExist
private static final java.lang.String[] UNARY_OPERATORS
private static final java.lang.String[] UNARY_METHODS
static final int K_PLUS
static final int K_MINUS
static final int K_SQRT
static final int K_ABS
final int kind
kind
represents the logical object
type. See also ValueNode.isSameNodeKind(org.apache.derby.impl.sql.compile.ValueNode)
.UnaryArithmeticOperatorNode(ValueNode operand, int kind, ContextManager cm) throws StandardException
operand
- The operand of the nodekind
- unary operator identitycm
- context managerStandardException
public boolean requiresTypeFromContext()
requiresTypeFromContext
in class ValueNode
ValueNode.requiresTypeFromContext()
public boolean isParameterNode()
isParameterNode
in class ValueNode
void bindParameter() throws StandardException
bindParameter
in class UnaryOperatorNode
StandardException
- Thrown if ? parameter doesn't
have a type bound to it yet.
? parameter where it isn't allowed.ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.List<AggregateNode> aggregates) throws StandardException
bindExpression
in class UnaryOperatorNode
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregates
- The aggregate list being built as we find AggregateNodesStandardException
- Thrown on errorprivate void checkOperandIsNumeric(TypeId operandType) throws StandardException
StandardException
void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class UnaryOperatorNode
acb
- The ExpressionClassBuilder for the class we're generatingmb
- The method the expression will go intoStandardException
- Thrown on errorprivate void bindSQRTABS() throws StandardException
StandardException
- Thrown on errorvoid setType(DataTypeDescriptor descriptor) throws StandardException
setType
in class ValueNode
descriptor
- The DataTypeServices to set in this
ValueNodeStandardException
boolean isSameNodeKind(ValueNode o)
ValueNode
ValueNode.isEquivalent(org.apache.derby.impl.sql.compile.ValueNode)
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
.isSameNodeKind
in class UnaryOperatorNode
o
- The other value node whose kind we want to compare with.true
if this
and o
represent the same
logical node type, i.e. kind.Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.