Interface Combiner.Container
- Enclosing class:
Combiner
public static interface Combiner.Container
Defines an object that can be used to accumulate values and
retrieve a result.
- Since:
- 20 Sep 2015
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(Combiner.Container container) Combines the content of a given container with this one.doubleReturns the combined result of all the values submitted so far.voidsubmit(double datum) Submits a new numeric value for accumulation to the result.
-
Method Details
-
submit
void submit(double datum) Submits a new numeric value for accumulation to the result. In general, NaN values should not be submitted.- Parameters:
datum- new value to accumulate
-
add
Combines the content of a given container with this one. The effect is the same as if all the data submitted to the supplied container had in fact been submitted to this one. The other container is assumed to be of the same type as this one; if not, a ClassCastException is likely to occur.- Parameters:
container- other container, of the same type as this one
-
getCombinedValue
double getCombinedValue()Returns the combined result of all the values submitted so far. In general, if no values have been submitted, a NaN should be returned.- Returns:
- combined value of all submitted data
-