Domain
- the type of elements to be aggregated.Accumulator
- the type used to store the interim results of the aggregate computation,
that may be incrementally refreshed upon updates to the multiset, and that can easily yield the final result.AggregateResult
- the type of the final result of the aggregation to be output.public interface IMultisetAggregationOperator<Domain,Accumulator,AggregateResult>
The operator provides two methods of computation:
#aggregateStatelessly(Collection)
.createNeutral()
, update(Object, Object, boolean)
, isNeutral(Object)
, getAggregate(Object)
.
In case of incremental computation, the aggregable multiset is conceptual; it is not represented by an explicit Collection In case of incremental computation, internal results, potentially distinct from the final aggregate result, may be stored in a helper data structure called accumulator.
The goal of this distinction is that the final result may not be sufficient for incremental updates (see e.g. ExtremumOperator
).
Modifier and Type | Method and Description |
---|---|
AggregateResult |
aggregateStream(java.util.stream.Stream<Domain> stream)
Calculates the aggregate results from a given stream of values; all values are considered as inserted
|
Accumulator |
createNeutral() |
AggregateResult |
getAggregate(Accumulator result) |
java.lang.String |
getName()
A name or identifier of the operator.
|
java.lang.String |
getShortDescription()
A textual description of the operator.
|
boolean |
isNeutral(Accumulator result) |
Accumulator |
update(Accumulator oldResult,
Domain updateValue,
boolean isInsertion) |
java.lang.String getShortDescription()
java.lang.String getName()
Accumulator createNeutral()
boolean isNeutral(Accumulator result)
Accumulator update(Accumulator oldResult, Domain updateValue, boolean isInsertion)
AggregateResult getAggregate(Accumulator result)
AggregateResult aggregateStream(java.util.stream.Stream<Domain> stream)