Class FixedIntervalSupplier

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected org.slf4j.Logger mLogger  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      long getNextInterval​(long mPreviousTickedMs, long nowTimeStampMillis)
      Gets the next interval for sleeping.
      long getRunLimit​(long mPreviousTickedMs)
      Gets the run limit from previous ticked.
      • Methods inherited from class java.lang.Object

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

      • mLogger

        protected final org.slf4j.Logger mLogger
    • Constructor Detail

      • FixedIntervalSupplier

        public FixedIntervalSupplier​(long fixedInterval,
                                     org.slf4j.Logger logger)
        Constructs a new FixedIntervalSupplier.
        Parameters:
        fixedInterval - the fixed interval
        logger - the logger
      • FixedIntervalSupplier

        public FixedIntervalSupplier​(long fixedInterval)
        Constructs a new FixedIntervalSupplier.
        Parameters:
        fixedInterval - the fixed interval
    • Method Detail

      • getNextInterval

        public long getNextInterval​(long mPreviousTickedMs,
                                    long nowTimeStampMillis)
        Description copied from interface: SleepIntervalSupplier
        Gets the next interval for sleeping.
        Specified by:
        getNextInterval in interface SleepIntervalSupplier
        Parameters:
        mPreviousTickedMs - previous ticked time stamp in millisecond
        nowTimeStampMillis - current time stamp in millisecond
        Returns:
        the interval to sleep starting from now before next time the timer triggers
      • getRunLimit

        public long getRunLimit​(long mPreviousTickedMs)
        Description copied from interface: SleepIntervalSupplier
        Gets the run limit from previous ticked.
        Specified by:
        getRunLimit in interface SleepIntervalSupplier
        Parameters:
        mPreviousTickedMs - previous ticked time stamp in millisecond
        Returns:
        the run limit