fm.liveswitch.MovingAverage Class Reference

A moving average. More...

Public Member Functions

void add (long value)
 Adds a sample. More...
 
long getAverage ()
 Gets the average. More...
 
 MovingAverage (int lookback)
 Initializes a new instance of the fm.liveswitch.MovingAverage class. More...
 

Detailed Description

A moving average.

Constructor & Destructor Documentation

◆ MovingAverage()

fm.liveswitch.MovingAverage.MovingAverage ( int  lookback)

Initializes a new instance of the fm.liveswitch.MovingAverage class.

Parameters
lookbackThe number of lookback values.

Member Function Documentation

◆ add()

void fm.liveswitch.MovingAverage.add ( long  value)

Adds a sample.

Parameters
valueThe value to add.

◆ getAverage()

long fm.liveswitch.MovingAverage.getAverage ( )

Gets the average.