Class PausableAverage


  • public class PausableAverage
    extends Average
    • Field Detail

      • offset

        private long offset
      • pause_time

        private long pause_time
    • Constructor Detail

      • PausableAverage

        private PausableAverage​(int _refreshRate,
                                int _period)
    • Method Detail

      • getPausableInstance

        public static PausableAverage getPausableInstance​(int refreshRate,
                                                          int period)
      • addValue

        public void addValue​(long value)
        Description copied from class: Average
        Public method to add a value to the average, the time it is added is the time this method is called.
        Overrides:
        addValue in class Average
        Parameters:
        value - the value to be added to the Average
      • getAverage

        public long getAverage()
        Description copied from class: Average
        This method can be called to get the current average value.
        Overrides:
        getAverage in class Average
        Returns:
        the current Average computed.
      • pause

        public void pause()
      • resume

        public void resume()