com.metamatrix.query.function.aggregate
Interface AggregateFunction

All Known Implementing Classes:
Avg, ConstantFunction, Count, DuplicateFilter, Max, Min, NullFilter, Sum

public interface AggregateFunction

This represents the interface for an aggregate function. The basic lifecycle is that the AggregateFunction is initialize()'d with the type of the element being aggregated, then addInput() is called for every row in the group, then getResult() is called to retrieve the result.


Method Summary
 void addInput(java.lang.Object input)
          Called for the element value in every row of a group.
 java.lang.Object getResult()
          Called after all values have been processed to get the result.
 void initialize(java.lang.Class dataType)
          Called to initialize the function.
 void reset()
          Called to reset the state of the function.
 

Method Detail

initialize

void initialize(java.lang.Class dataType)
Called to initialize the function. In the future this may expand with additional information.

Parameters:
dataType - Data type of element begin aggregated

reset

void reset()
Called to reset the state of the function.


addInput

void addInput(java.lang.Object input)
              throws FunctionExecutionException,
                     ExpressionEvaluationException,
                     MetaMatrixComponentException
Called for the element value in every row of a group.

Parameters:
input - Input value, may be null
Throws:
FunctionExecutionException
ExpressionEvaluationException
MetaMatrixComponentException

getResult

java.lang.Object getResult()
                           throws FunctionExecutionException,
                                  ExpressionEvaluationException,
                                  MetaMatrixComponentException,
                                  MetaMatrixProcessingException
Called after all values have been processed to get the result.

Returns:
Result value
Throws:
MetaMatrixProcessingException
FunctionExecutionException
ExpressionEvaluationException
MetaMatrixComponentException


Copyright © 2009. All Rights Reserved.