public class RollingStatCalculator extends Object
Modifier and Type | Field and Description |
---|---|
private int |
currentIndexPosition |
private double |
currentSqrSum |
private double |
currentSum |
private long[] |
dataValues |
private long |
numberOfDataValues |
private int |
rollingPeriod |
Constructor and Description |
---|
RollingStatCalculator(int rollingPeriod)
Creates a RollingStatCalculator with given number of rolling periods.
|
Modifier and Type | Method and Description |
---|---|
private long[] |
fillWithZeros(int size) |
double |
getDeviation() |
double |
getMean() |
void |
insertDataValue(long data)
Inserts given data value to array of data values to be considered for statistics calculation
|
private void |
removeData(long data)
Update the statistics after removing the given data value
|
private double currentSum
private double currentSqrSum
private long numberOfDataValues
private int rollingPeriod
private int currentIndexPosition
private long[] dataValues
public RollingStatCalculator(int rollingPeriod)
rollingPeriod
- public void insertDataValue(long data)
data
- private void removeData(long data)
data
- public double getMean()
public double getDeviation()
private long[] fillWithZeros(int size)
size
- Copyright © 2007–2019 The Apache Software Foundation. All rights reserved.