Class RunningAverageValueProcessor.RunningAverageBufferCalculator

java.lang.Object
org.scictrl.csshell.epics.server.processor.RunningAverageValueProcessor.RunningAverageBufferCalculator
Enclosing class:
RunningAverageValueProcessor

public static class RunningAverageValueProcessor.RunningAverageBufferCalculator extends Object
Average calculator.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
    Calculated average.
    double[]
    Accumulated data, circular buffer.
    int
    Index in circular buffer;
    double
    Maximal value.
    double
    Minimal value.
    int
    Actual number of accumulated points
    double
    Calculated STD.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(double value)
    Adds value
    void
    Resets buffer to be empty.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • data

      public double[] data
      Accumulated data, circular buffer.
    • idx

      public int idx
      Index in circular buffer;
    • size

      public int size
      Actual number of accumulated points
    • avg

      public double avg
      Calculated average.
    • std

      public double std
      Calculated STD.
    • min

      public double min
      Minimal value.
    • max

      public double max
      Maximal value.
  • Constructor Details

    • RunningAverageBufferCalculator

      public RunningAverageBufferCalculator(int size)
      Constructor.
      Parameters:
      size - size of buffer
  • Method Details

    • reset

      public void reset()
      Resets buffer to be empty.
    • add

      public void add(double value)
      Adds value
      Parameters:
      value - new value