Class POBTimeoutHandler

  • All Implemented Interfaces:

    @MainThread() 
    public class POBTimeoutHandler
    
                        

    Class to handle custom implementation Timeout. To start the delay you can use start to cancel existing delay you can use cancel

    Note: All the methods of this class should be called from MainThread only.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      public interface POBTimeoutHandler.POBTimeoutHandlerListener

      Interface definition to notify the time interval completes the delay and timeout is about to happen. Notification will always happens on MainThread

    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      boolean start(long delayInMs) Schedules the specified task for execution after the specified delay.
      boolean startAtFixedRate(long delayInMS, long period) Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
      void cancel() Reset already running timer.
      • Methods inherited from class java.lang.Object

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

      • start

        @MainThread() boolean start(long delayInMs)

        Schedules the specified task for execution after the specified delay. Note: If the task is already running, calling this method will cancels the existing task and schedules new task If delay is negative, timer won't start.

        Parameters:
        delayInMs - the delay time in millisecond.
        Returns:

        true if timeout starts successfully, else returns false

      • startAtFixedRate

        @MainThread() boolean startAtFixedRate(long delayInMS, long period)

        Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay. Subsequent executions take place at approximately regular intervals, separated by the specified period. Note: If the task is already running, calling this method will cancels the existing task and schedules new task If delay is negative, timer won't start.

        Parameters:
        delayInMS - the delay time in millisecond.
        period - regular interval time in millisecond
        Returns:

        true if timeout starts successfully, else returns false

      • cancel

        @MainThread() void cancel()

        Reset already running timer. This will be the last state of the timer. You should create new object for further usage.