Package com.storedobject.common
Class Accumulator<T>
java.lang.Object
com.storedobject.common.Accumulator<T>
- Type Parameters:
T
- Value type.
- Direct Known Subclasses:
ParallelAccumulator
Accumulator function that is used to accumulate values (for example, a sum or a product) of a series of values.
- Author:
- Syam
-
Constructor Summary
ConstructorsConstructorDescriptionAccumulator
(BiFunction<T, T, T> accumulator) Create an Accumulator instance by passing a ByFunction. -
Method Summary
-
Constructor Details
-
Accumulator
Create an Accumulator instance by passing a ByFunction.- Parameters:
accumulator
- Bi-function with function arguments and result of the same type.
-
-
Method Details
-
get
Gets the value from the accumulator.- Returns:
- value The value after calculation is applied for the series of values.
-
accept
Accepts values for calculation- Parameters:
value
- A value restricted to a specific type T.
-