org.apache.derby.impl.sql.compile
Class UnaryArithmeticOperatorNode

java.lang.Object
  extended byorg.apache.derby.impl.sql.compile.QueryTreeNode
      extended byorg.apache.derby.impl.sql.compile.ValueNode
          extended byorg.apache.derby.impl.sql.compile.UnaryOperatorNode
              extended byorg.apache.derby.impl.sql.compile.UnaryArithmeticOperatorNode
All Implemented Interfaces:
Visitable

public class UnaryArithmeticOperatorNode
extends UnaryOperatorNode

This node represents a unary arithmetic operator

Author:
Manish Khettry

Field Summary
private static int ABSOLUTE
           
private  int operatorType
           
private static int SQRT
           
private static java.lang.String[] UNARY_METHODS
           
private static int UNARY_MINUS
           
private static java.lang.String[] UNARY_OPERATORS
           
private static int UNARY_PLUS
           
 
Fields inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode
IS_NULL, methodName, NOT, operand, operator
 
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
UnaryArithmeticOperatorNode()
           
 
Method Summary
 ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector)
          Bind this operator
(package private)  void bindParameter()
          By default unary operators don't accept ?
private  void bindSQRTABS()
          Bind SQRT or ABS
 void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
          Do code generation for this unary plus operator
 void init(java.lang.Object operand)
          Initializer for a UnaryArithmeticOperatorNode
 
Methods inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode
accept, bindUnaryOperator, categorize, constantExpression, getOperand, getOperatorString, getOrderableVariantType, getReceiverInterfaceName, init, isConstantExpression, preprocess, printSubNodes, remapColumnReferencesToExpressions, setClause, setMethodName, setOperator, toString
 
Methods inherited from class org.apache.derby.impl.sql.compile.ValueNode
bindExpression, changeToCNF, checkIsBoolean, checkReliability, checkReliability, checkTopPredicatesForEqualsConditions, copyFields, eliminateNots, genEqualsFalseTree, generate, generateFilter, genIsNullTree, genSQLJavaSQLTree, getClause, getClone, getColumnName, getConstantValueAsObject, getDataValueFactory, getSchemaName, getSourceResultColumn, getTableName, getTablesReferenced, getTransformed, getTypeCompiler, getTypeId, getTypeServices, init, isBinaryEqualsOperatorNode, isBooleanFalse, isBooleanTrue, isCloneable, isParameterNode, isRelationalOperator, optimizableEqualityNode, putAndsOnTop, selectivity, setDescriptor, setTransformed, setType, verifyChangeToCNF, verifyEliminateNots, verifyPutAndsOnTop
 
Methods inherited from class org.apache.derby.impl.sql.compile.QueryTreeNode
bind, convertDefaultNode, debugFlush, debugPrint, executeSchemaName, executeStatementName, formatNodeString, foundString, generate, generateAuthorizeCheck, getBeginOffset, getClassFactory, getCompilerContext, getContextManager, getCursorInfo, getDataDictionary, getDependencyManager, getEndOffset, getExecutionFactory, getGenericConstantActionFactory, getIntProperty, getLanguageConnectionContext, getNodeFactory, getNodeType, getNullNode, getParameterTypes, getRowEstimate, getSchemaDescriptor, getSchemaDescriptor, getSPSName, getStatementType, getTableDescriptor, getTypeCompiler, init, init, init, init, init, init, init, init, init, init, init, isAtomic, isInstanceOf, isSessionSchema, isSessionSchema, makeConstantAction, makeResultDescription, makeTableName, needsSavepoint, nodeHeader, optimize, parseQueryText, printLabel, referencesSessionSchema, setBeginOffset, setContextManager, setEndOffset, setNodeType, setRefActionInfo, treePrint, treePrint, verifyClassExist
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNARY_PLUS

private static final int UNARY_PLUS
See Also:
Constant Field Values

UNARY_MINUS

private static final int UNARY_MINUS
See Also:
Constant Field Values

SQRT

private static final int SQRT
See Also:
Constant Field Values

ABSOLUTE

private static final int ABSOLUTE
See Also:
Constant Field Values

UNARY_OPERATORS

private static final java.lang.String[] UNARY_OPERATORS

UNARY_METHODS

private static final java.lang.String[] UNARY_METHODS

operatorType

private int operatorType
Constructor Detail

UnaryArithmeticOperatorNode

public UnaryArithmeticOperatorNode()
Method Detail

init

public void init(java.lang.Object operand)
Initializer for a UnaryArithmeticOperatorNode

Overrides:
init in class UnaryOperatorNode
Parameters:
operand - The operand of the node

bindParameter

void bindParameter()
             throws StandardException
By default unary operators don't accept ? parameters as operands. This can be over-ridden for particular unary operators. We throw an exception if the parameter doesn't have a datatype assigned to it yet.

Overrides:
bindParameter in class UnaryOperatorNode
Returns:
Nothing
Throws:
StandardException - Thrown if ? parameter doesn't have a type bound to it yet. ? parameter where it isn't allowed.

bindExpression

public ValueNode bindExpression(FromList fromList,
                                SubqueryList subqueryList,
                                java.util.Vector aggregateVector)
                         throws StandardException
Bind this operator

Overrides:
bindExpression in class UnaryOperatorNode
Parameters:
fromList - The query's FROM list
subqueryList - The subquery list being built as we find SubqueryNodes
aggregateVector - The aggregate vector being built as we find AggregateNodes
Returns:
The new top of the expression tree.
Throws:
StandardException - Thrown on error

generateExpression

public void generateExpression(ExpressionClassBuilder acb,
                               MethodBuilder mb)
                        throws StandardException
Do code generation for this unary plus operator

Overrides:
generateExpression in class UnaryOperatorNode
Parameters:
acb - The ExpressionClassBuilder for the class we're generating
mb - The method the expression will go into
Throws:
StandardException - Thrown on error

bindSQRTABS

private void bindSQRTABS()
                  throws StandardException
Bind SQRT or ABS

Throws:
StandardException - Thrown on error


Apache Derby V10.0 Engine Documentation - Copyright © 1997,2004 The Apache Software Foundation or its licensors, as applicable.