Class Notifier

    • Constructor Detail

      • Notifier

        public Notifier​(Runnable run)
        Create a Notifier for timer event notification.
        Parameters:
        run - The handler that is called at the notification time which is set using StartSingle or StartPeriodic.
    • Method Detail

      • finalize

        protected void finalize()
        Overrides:
        finalize in class Object
      • setHandler

        public void setHandler​(Runnable handler)
        Change the handler function.
        Parameters:
        handler - Handler
      • startSingle

        public void startSingle​(double delay)
        Register for single event notification. A timer event is queued for a single event after the specified delay.
        Parameters:
        delay - Seconds to wait before the handler is called.
      • startPeriodic

        public void startPeriodic​(double period)
        Register for periodic event notification. A timer event is queued for periodic event notification. Each time the interrupt occurs, the event will be immediately requeued for the same time interval.
        Parameters:
        period - Period in seconds to call the handler starting one period after the call to this method.
      • stop

        public void stop()
        Stop timer events from occurring. Stop any repeating timer events from occurring. This will also remove any single notification events from the queue. If a timer-based call to the registered handler is in progress, this function will block until the handler call is complete.