|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.compile.QueryTreeNode
org.apache.derby.impl.sql.compile.ValueNode
org.apache.derby.impl.sql.compile.UnaryOperatorNode
org.apache.derby.impl.sql.compile.AggregateNode
An Aggregate Node is a node that reprsents a set function/aggregate. It used for all system aggregates as well as user defined aggregates.
Field Summary | |
private java.lang.Class |
aggregateDefinitionClass
|
private java.lang.String |
aggregateDefinitionClassName
|
private java.lang.String |
aggregateName
|
private java.lang.StringBuffer |
aggregatorClassName
|
private ClassInspector |
classInspector
|
private boolean |
distinct
|
private ResultColumn |
generatedRC
|
private ColumnReference |
generatedRef
|
private AggregateDefinition |
uad
|
Fields inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
IS_NULL, methodName, NOT, operand, operator, operatorType, receiverInterfaceType, resultInterfaceType, UNARY_MINUS, UNARY_PLUS, UnaryArgTypes, UnaryMethodNames, UnaryOperators, UnaryResultTypes, XMLPARSE_OP, XMLSERIALIZE_OP |
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 | |
AggregateNode()
|
Method Summary | |
ValueNode |
bindExpression(FromList fromList,
SubqueryList subqueryList,
java.util.Vector aggregateVector)
Bind this operator. |
private void |
checkAggregatorClassName(java.lang.String className)
|
void |
generateExpression(ExpressionClassBuilder acb,
MethodBuilder mb)
Do code generation for this unary operator. |
(package private) AggregateDefinition |
getAggregateDefinition()
Get the AggregateDefinition. |
java.lang.String |
getAggregateName()
Get the class that implements that aggregator for this node. |
java.lang.String |
getAggregatorClassName()
Get the class that implements that aggregator for this node. |
ResultColumn |
getGeneratedRC()
Get the generated ResultColumn where this aggregate now resides after a call to replaceAggregatesWithColumnReference(). |
ColumnReference |
getGeneratedRef()
Get the generated ColumnReference to this aggregate after the parent called replaceAggregatesWithColumnReference(). |
ResultColumn |
getNewAggregatorResultColumn(DataDictionary dd)
Get the result column that has a new aggregator. |
ResultColumn |
getNewExpressionResultColumn(DataDictionary dd)
Get the aggregate expression in a new result column. |
ValueNode |
getNewNullResultExpression()
Get the null aggregate result expression column. |
void |
init(java.lang.Object operand,
java.lang.Object uadClass,
java.lang.Object distinct,
java.lang.Object aggregateName)
Intializer. |
private void |
instantiateAggDef()
|
boolean |
isDistinct()
Indicate whether this aggregate is distinct or not. |
ValueNode |
replaceAggregatesWithColumnReferences(ResultColumnList rcl,
int tableNumber)
Replace aggregates in the expression tree with a ColumnReference to that aggregate, append the aggregate to the supplied RCL (assumed to be from the child ResultSetNode) and return the ColumnReference. |
java.lang.String |
toString()
Print a string ref of this node. |
Methods inherited from class org.apache.derby.impl.sql.compile.UnaryOperatorNode |
accept, addMethodParams, bindParameter, bindUnaryOperator, bindXMLParse, bindXMLSerialize, categorize, constantExpression, getOperand, getOperatorString, getOrderableVariantType, getReceiverInterfaceName, init, init, isConstantExpression, preprocess, printSubNodes, remapColumnReferencesToExpressions, setClause, setMethodName, setOperator |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private boolean distinct
private AggregateDefinition uad
private java.lang.StringBuffer aggregatorClassName
private java.lang.String aggregateDefinitionClassName
private java.lang.Class aggregateDefinitionClass
private ClassInspector classInspector
private java.lang.String aggregateName
private ResultColumn generatedRC
private ColumnReference generatedRef
Constructor Detail |
public AggregateNode()
Method Detail |
public void init(java.lang.Object operand, java.lang.Object uadClass, java.lang.Object distinct, java.lang.Object aggregateName) throws StandardException
init
in class QueryTreeNode
operand
- the value expression for the aggregateuadClass
- the class name for user aggregate definition for the aggregate
or the Class for the internal aggregate type.distinct
- boolean indicating whether this is distinct
or not.aggregateName
- the name of the aggregate from the user's perspective,
e.g. MAX
StandardException
- on errorpublic ValueNode replaceAggregatesWithColumnReferences(ResultColumnList rcl, int tableNumber) throws StandardException
tableNumber
- The tableNumber for the new ColumnReference
StandardException
- Thrown on errorAggregateDefinition getAggregateDefinition()
public ResultColumn getGeneratedRC()
public ColumnReference getGeneratedRef()
public ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, java.util.Vector aggregateVector) throws StandardException
bindExpression
in class UnaryOperatorNode
fromList
- The query's FROM listsubqueryList
- The subquery list being built as we find SubqueryNodesaggregateVector
- The aggregate list being built as we find AggregateNodes
StandardException
- Thrown on errorprivate void checkAggregatorClassName(java.lang.String className) throws StandardException
StandardException
private void instantiateAggDef() throws StandardException
StandardException
public boolean isDistinct()
public java.lang.String getAggregatorClassName()
public java.lang.String getAggregateName()
public ResultColumn getNewAggregatorResultColumn(DataDictionary dd) throws StandardException
StandardException
- on errorpublic ResultColumn getNewExpressionResultColumn(DataDictionary dd) throws StandardException
StandardException
- on errorpublic ValueNode getNewNullResultExpression() throws StandardException
StandardException
- on errorpublic void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb) throws StandardException
generateExpression
in class UnaryOperatorNode
acb
- The ExpressionClassBuilder for the class we're generatingmb
- The method the code to place the code
StandardException
- Thrown on errorpublic java.lang.String toString()
toString
in class UnaryOperatorNode
|
Built on Tue 2006-10-10 19:23:47+0200, from revision exported | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |