Package org.eclipse.jgit.util
Class Stats
java.lang.Object
org.eclipse.jgit.util.Stats
Simple double statistics, computed incrementally, variance and standard
deviation using Welford's online algorithm, see
https://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Welford's_online_algorithm
- Since:
- 5.1.9
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
n
private int n -
avg
private double avg -
min
private double min -
max
private double max -
sum
private double sum
-
-
Constructor Details
-
Stats
public Stats()
-
-
Method Details
-
add
public void add(double x) Add a value- Parameters:
x
- value
-
count
public int count()- Returns:
- number of the added values
-
min
public double min()- Returns:
- minimum of the added values
-
max
public double max()- Returns:
- maximum of the added values
-
avg
public double avg()- Returns:
- average of the added values
-
var
public double var()- Returns:
- variance of the added values
-
stddev
public double stddev()- Returns:
- standard deviation of the added values
-