Package org.midheaven.math
Interface ArithmeticAccumulator<T,R>
- Type Parameters:
T- type of the element in the ArithmeticR- type of the resulting element
public interface ArithmeticAccumulator<T,R>
Defines the contract for Arithmetic Accumulator.
-
Method Summary
Modifier and TypeMethodDescriptionvoidaccumulate(T value) Performs accumulate.combine(ArithmeticAccumulator<T, R> other) Performs combine.Creates new Instance.result()Performs result.
-
Method Details
-
newInstance
ArithmeticAccumulator<T,R> newInstance()Creates new Instance.- Returns:
- the result of newInstance
-
accumulate
Performs accumulate.- Parameters:
value- the value value
-
combine
Performs combine.- Parameters:
other- the other value- Returns:
- the result of combine
-
result
R result()Performs result.- Returns:
- the result of result
-