Interface Aggregator<T>
-
- All Known Implementing Classes:
Aggregators.BooleanMajority,Aggregators.Collect,Aggregators.Concatenate,Aggregators.ConcatenateUnique,Aggregators.Count,Aggregators.DateMax,Aggregators.DateMean,Aggregators.DateMedian,Aggregators.DateMin,Aggregators.DoubleMax,Aggregators.DoubleMean,Aggregators.DoubleMedian,Aggregators.DoubleMin,Aggregators.DoubleSum,Aggregators.IntMax,Aggregators.IntMean,Aggregators.IntMedian,Aggregators.IntMin,Aggregators.IntSum,Aggregators.LongMax,Aggregators.LongMean,Aggregators.LongMedian,Aggregators.LongMin,Aggregators.LongSum,Aggregators.StringMajority,Aggregators.StringMax,Aggregators.StringMin,Aggregators.Union
public interface Aggregator<T>An aggregator accumulate individual values with addValue method and return a synthetic value with getResult method.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSEPARATOR_NAME
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddValue(T value)Adds a new value to the aggregator.Aggregator<?>clone()Create a new Aggregator with the same attributes as this one.StringgetName()Returns the name of this Aggregator.AttributeTypegetOutputAttributeType()ObjectgetParameter(String name)Returns parameter value for name parameter.Set<String>getParameters()Return parameter names used by this aggregatorObjectgetResult()List<T>getValues()booleanignoreNull()Returns true if this aggregator must ignore null values.voidreset()Reset the aggregator (clear the list of values)voidsetIgnoreNull(boolean ignoreNull)Change the way this aggregator process null values.voidsetParameter(String name, Object value)Set a parameter value for this aggregator.
-
-
-
Field Detail
-
SEPARATOR_NAME
static final String SEPARATOR_NAME
- See Also:
- Constant Field Values
-
-
Method Detail
-
clone
Aggregator<?> clone()
Create a new Aggregator with the same attributes as this one.
-
ignoreNull
boolean ignoreNull()
Returns true if this aggregator must ignore null values.
-
setIgnoreNull
void setIgnoreNull(boolean ignoreNull)
Change the way this aggregator process null values.
-
getParameters
Set<String> getParameters()
Return parameter names used by this aggregator- Returns:
- the set of parameters
-
setParameter
void setParameter(String name, Object value)
Set a parameter value for this aggregator.- Parameters:
name- the name of the aggregatorvalue- the new value of the parameter
-
getParameter
Object getParameter(String name)
Returns parameter value for name parameter.- Parameters:
name- the name of the parameter
-
getName
String getName()
Returns the name of this Aggregator.
-
getOutputAttributeType
AttributeType getOutputAttributeType()
- Returns:
- the AttributeType of the aggregated value.
-
addValue
void addValue(T value)
Adds a new value to the aggregator.- Parameters:
value- value to be added
-
getResult
Object getResult()
- Returns:
- the aggregated value.
-
reset
void reset()
Reset the aggregator (clear the list of values)
-
-