public class Sum extends Object implements AggregatorInstance<Long>
Sum can be used with most numeric types
Modifier and Type | Method and Description |
---|---|
void |
accept(Object input)
Add the given value to the aggregator function
|
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
|
public Sum(Attribute<?> attribute)
attribute
- public Sum createClone()
createClone
in interface AggregatorInstance<Long>
public void accept(Object input) throws AggregatorException
NOTE: null inputs are ignored
accept
in interface AggregatorInstance<Long>
input
- a single input valueAggregatorException
- if the function cannot be computed, possibly due to unsupported typespublic Number aggregateResult()
NOTE: May return null if no input supplied
aggregateResult
in interface AggregatorInstance<Long>
public Attribute getAttribute()
getAttribute
in interface AggregatorInstance<Long>
Copyright © 2003–2015 Terracotta, Inc.. All rights reserved.