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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(Combiner.Container container)
Combines the content of a given container with this one.double
getCombinedValue()
Returns the combined result of all the values submitted so far.void
submit(double datum)
Submits a new numeric value for accumulation to the result.
-
-
-
Method Detail
-
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
void add(Combiner.Container container)
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
-
-