Top Description Fields Constructors Methods
org.apache.derby.impl.sql.compile

pack-priv Class MaxMinAggregateDefinition

extends Object
implements AggregateDefinition
Class Inheritance
All Implemented Interfaces
org.apache.derby.impl.sql.compile.AggregateDefinition
Imports
org.apache.derby.shared.common.reference.ClassName, org.apache.derby.iapi.services.context.Context, .ContextService, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.types.DataTypeDescriptor, .TypeId

Defintion for the MAX()/MIN() aggregates.

Field Summary

Modifier and TypeField and Description
private boolean

Constructor Summary

AccessConstructor and Description
public
MaxMinAggregateDefinition()

Niladic constructor.

Method Summary

Modifier and TypeMethod and Description
public final DataTypeDescriptor

Returns:

the output Class (null if cannot operate on value expression of this type.
getAggregator
(DataTypeDescriptor
the input type, either a user type or a java.lang object
inputType
,
StringBuffer
output parameter, filled in with the class name that implements com.ibm.db2j.aggregates.Aggregator
aggregatorClass
)

Implements org.apache.derby.impl.sql.compile.AggregateDefinition.getAggregator.

Determines the result datatype.

pack-priv final boolean

Returns:

boolean true/false
isMax
()

Return if the aggregator class is for min/max.

pack-priv final void
setMaxOrMin(boolean isMax)

This is set by the parser.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

isMaxback to summary
private boolean isMax

Constructor Detail

MaxMinAggregateDefinitionback to summary
public MaxMinAggregateDefinition()

Niladic constructor. Does nothing. For ease Of use, only.

Method Detail

getAggregatorback to summary
public final DataTypeDescriptor getAggregator(DataTypeDescriptor inputType, StringBuffer aggregatorClass)

Implements org.apache.derby.impl.sql.compile.AggregateDefinition.getAggregator.

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().

Parameters
inputType:DataTypeDescriptor

the input type, either a user type or a java.lang object

aggregatorClass:StringBuffer

Doc from org.apache.derby.impl.sql.compile.AggregateDefinition.getAggregator.

output parameter, filled in with the class name that implements com.ibm.db2j.aggregates.Aggregator

Returns:DataTypeDescriptor

the output Class (null if cannot operate on value expression of this type.

isMaxback to summary
pack-priv final boolean isMax()

Return if the aggregator class is for min/max.

Returns:boolean

boolean true/false

setMaxOrMinback to summary
pack-priv final void setMaxOrMin(boolean isMax)

This is set by the parser.