Package io.activej.aggregation
Interface Aggregate<T,A>
public interface Aggregate<T,A>
Accumulates records using arithmetic summation.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(A accumulator, T record) Performs the following operation: accumulator = accumulator + record.createAccumulator(T record) Creates an object which holds arithmetic sum of accumulated records.
-
Method Details
-
createAccumulator
Creates an object which holds arithmetic sum of accumulated records.- Parameters:
record- record whose fields are to be accumulated- Returns:
- accumulator object
-
accumulate
Performs the following operation: accumulator = accumulator + record.- Parameters:
accumulator- accumulator which holds the current sum of recordsrecord- record to add to the accumulator
-