public class Sum extends java.lang.Object implements AggregatorInstance<java.lang.Long>
Modifier and Type | Class and Description |
---|---|
(package private) static class |
Sum.Engine
Abstract super-class for all sum calculating engines.
|
Modifier and Type | Field and Description |
---|---|
private Attribute<?> |
attribute |
private Sum.Engine |
engine |
Modifier and Type | Method and Description |
---|---|
void |
accept(java.lang.Object input)
Add the given value to the aggregator function
|
java.lang.Number |
aggregateResult()
Retrieve the final result
|
Sum |
createClone()
Create a clone of this aggregator, detaching from its result
|
Attribute |
getAttribute()
Get the attribute to pass to aggregator
|
private final Attribute<?> attribute
private Sum.Engine engine
public Sum(Attribute<?> attribute)
attribute
- public Sum createClone()
createClone
in interface AggregatorInstance<java.lang.Long>
public void accept(java.lang.Object input) throws AggregatorException
accept
in interface AggregatorInstance<java.lang.Long>
input
- a single input valueAggregatorException
- if the function cannot be computed, possibly due to unsupported typespublic java.lang.Number aggregateResult()
aggregateResult
in interface AggregatorInstance<java.lang.Long>
public Attribute getAttribute()
getAttribute
in interface AggregatorInstance<java.lang.Long>