Class MaxMinAggregator
java.lang.Object
org.apache.derby.impl.sql.execute.SystemAggregator
org.apache.derby.impl.sql.execute.OrderableAggregator
org.apache.derby.impl.sql.execute.MaxMinAggregator
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat, ExecAggregator
Aggregator for MAX()/MIN(). Defers most of its work
to OrderableAggregator.
- See Also:
-
Field Summary
FieldsFields inherited from class OrderableAggregator
value -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaccumulate(DataValueDescriptor addend) AccumulateintGet the formatID which corresponds to this class.Return a new initialized copy of this aggregator, any state set by the setup() method of the original Aggregator must be copied into the new aggregator.voidvoidsetup(ClassFactory cf, String aggregateName, DataTypeDescriptor returnType) Set's up the aggregate for processing.void//////////////////////////////////////////////////////////Methods inherited from class OrderableAggregator
getResult, merge, toStringMethods inherited from class SystemAggregator
accumulate, didEliminateNulls
-
Field Details
-
isMax
private boolean isMax
-
-
Constructor Details
-
MaxMinAggregator
public MaxMinAggregator()
-
-
Method Details
-
setup
Description copied from interface:ExecAggregatorSet's up the aggregate for processing.- Specified by:
setupin interfaceExecAggregator- Overrides:
setupin classOrderableAggregator- Parameters:
cf- Database-specific class factory.aggregateName- For builtin aggregates, this is a SQL aggregate name like MAX. For user-defined aggregates, this is the name of the user-written class which implements org.apache.derby.agg.Aggregator.returnType- The type returned by the getResult() method.
-
accumulate
Accumulate- Specified by:
accumulatein classSystemAggregator- Parameters:
addend- value to be added in- Throws:
StandardException- on error
-
newAggregator
Description copied from interface:ExecAggregatorReturn a new initialized copy of this aggregator, any state set by the setup() method of the original Aggregator must be copied into the new aggregator.- Returns:
- ExecAggregator the new aggregator
-
writeExternal
//////////////////////////////////////////////////////////- Specified by:
writeExternalin interfaceExternalizable- Overrides:
writeExternalin classOrderableAggregator- Throws:
IOException- on error- See Also:
-
readExternal
- Specified by:
readExternalin interfaceExternalizable- Overrides:
readExternalin classOrderableAggregator- Throws:
IOException- on errorClassNotFoundException- on error- See Also:
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Returns:
- the formatID of this class
-