public class WeightedAverage extends Object
Constructor and Description |
---|
WeightedAverage() |
Modifier and Type | Method and Description |
---|---|
WeightedAverage |
add(int w,
Number v)
Add a number with a weight to this average.
|
double |
getValue()
Returns the weighted average of all numbers.
|
public WeightedAverage()
public WeightedAverage add(int w, Number v)
w
- The weight of the new value.v
- The new value.public double getValue()
Copyright © 2016–2020 The Apache Software Foundation. All rights reserved.