Class AggregateFunctions.AggregateAverage

java.lang.Object
com.fluxtion.ext.streaming.api.group.AggregateFunctions.AggregateAverage
All Implemented Interfaces:
NumericFunctionStateful, NumericFunctionStateless
Enclosing class:
AggregateFunctions

public static class AggregateFunctions.AggregateAverage
extends java.lang.Object
implements NumericFunctionStateful
  • Constructor Summary

    Constructors 
    Constructor Description
    AggregateAverage()  
  • Method Summary

    Modifier and Type Method Description
    double calcAverage​(double newValue, double oldAverage)  
    double reset()
    A stateful function should be reset to initial state on receiving this call.

    Methods inherited from class java.lang.Object

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

  • Method Details

    • calcAverage

      public double calcAverage​(double newValue, double oldAverage)
    • reset

      public double reset()
      Description copied from interface: NumericFunctionStateful
      A stateful function should be reset to initial state on receiving this call. For example an average calculation would zero all counts and sums.
      Specified by:
      reset in interface NumericFunctionStateful
      Returns:
      the reset value for this calculation