Class MaxMinAggregateDefinition
- java.lang.Object
-
- org.apache.derby.impl.sql.compile.MaxMinAggregateDefinition
-
- All Implemented Interfaces:
AggregateDefinition
class MaxMinAggregateDefinition extends java.lang.Object implements AggregateDefinition
Defintion for the MAX()/MIN() aggregates.
-
-
Field Summary
Fields Modifier and Type Field Description private booleanisMax
-
Constructor Summary
Constructors Constructor Description MaxMinAggregateDefinition()Niladic constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataTypeDescriptorgetAggregator(DataTypeDescriptor inputType, java.lang.StringBuffer aggregatorClass)Determines the result datatype.(package private) booleanisMax()Return if the aggregator class is for min/max.(package private) voidsetMaxOrMin(boolean isMax)This is set by the parser.
-
-
-
Method Detail
-
getAggregator
public final DataTypeDescriptor getAggregator(DataTypeDescriptor inputType, java.lang.StringBuffer aggregatorClass)
Determines the result datatype. Accept NumberDataValues only.Note: In the future you should be able to do a sum user data types. One option would be to run sum on anything that implements divide().
- Specified by:
getAggregatorin interfaceAggregateDefinition- Parameters:
inputType- the input type, either a user type or a java.lang objectaggregatorClass- output parameter, filled in with the class name that implements com.ibm.db2j.aggregates.Aggregator- Returns:
- the output Class (null if cannot operate on value expression of this type.
- See Also:
TypeDescriptor
-
setMaxOrMin
final void setMaxOrMin(boolean isMax)
This is set by the parser.
-
isMax
final boolean isMax()
Return if the aggregator class is for min/max.- Returns:
- boolean true/false
-
-