Class Notifier

    • Constructor Detail

      • Notifier

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

      • finalize

        protected void finalize()
        finalize in class Object
      • setName

        public void setName​(String name)
        Sets the name of the notifier. Used for debugging purposes only.
        name - Name
      • setHandler

        public void setHandler​(Runnable handler)
        Change the handler function.
        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.
        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.
        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.