public class WeightedMeanAccumulator extends Object implements Accumulator<WeightedValue<Double>>
Constructor and Description |
---|
WeightedMeanAccumulator() |
Modifier and Type | Method and Description |
---|---|
void |
add(WeightedValue<Double> value)
Adds a value to the accumulator.
|
WeightedValue<Double> |
getResult()
Returns the weighted mean of all accumulated values.
|
void |
reset()
Resets the accumulator to its default state, please note that this results to the accumulated value of Double.NaN
as there is nothing accumulated and no mean can be computed.
|
public void add(WeightedValue<Double> value)
Accumulator
add
in interface Accumulator<WeightedValue<Double>>
value
- The value to be accumulated.public WeightedValue<Double> getResult()
getResult
in interface Accumulator<WeightedValue<Double>>
public void reset()
reset
in interface Accumulator<WeightedValue<Double>>
Copyright © 2010–2017 PerfCake Community. All rights reserved.