|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.metamatrix.query.function.aggregate.Sum
public class Sum
Accumulates (per tuple) and calculates the sum of the values
of a column. The type of the result varies depending on the type
of the input AggregateSymbol
Field Summary | |
---|---|
protected int |
accumulatorType
|
protected static int |
BIG_DECIMAL
|
protected static int |
BIG_INTEGER
|
protected static int |
DOUBLE
|
protected static int |
LONG
|
Constructor Summary | |
---|---|
Sum()
Constructor for Sum. |
Method Summary | |
---|---|
void |
addInput(java.lang.Object input)
Called for the element value in every row of a group. |
protected int |
getAccumulatorType()
Allows subclasses to determine type of accumulator for the SUM. |
java.lang.Object |
getResult()
Called after all values have been processed to get the result. |
void |
initialize(java.lang.Class dataType,
java.lang.Class inputType)
Called to initialize the function. |
void |
reset()
Called to reset the state of the function. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final int LONG
protected static final int DOUBLE
protected static final int BIG_INTEGER
protected static final int BIG_DECIMAL
protected int accumulatorType
Constructor Detail |
---|
public Sum()
Method Detail |
---|
protected int getAccumulatorType()
public void initialize(java.lang.Class dataType, java.lang.Class inputType)
AggregateFunction
initialize
in interface AggregateFunction
dataType
- Data type of element begin aggregatedcom.metamatrix.query.function.aggregate.AggregateFunction#initialize(boolean, String)
public void reset()
AggregateFunction
reset
in interface AggregateFunction
public void addInput(java.lang.Object input) throws FunctionExecutionException, ExpressionEvaluationException, MetaMatrixComponentException
AggregateFunction
addInput
in interface AggregateFunction
input
- Input value, may be null
FunctionExecutionException
ExpressionEvaluationException
MetaMatrixComponentException
AggregateFunction.addInput(Object)
public java.lang.Object getResult() throws FunctionExecutionException, ExpressionEvaluationException, MetaMatrixComponentException
AggregateFunction
getResult
in interface AggregateFunction
FunctionExecutionException
ExpressionEvaluationException
MetaMatrixComponentException
AggregateFunction.getResult()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |