public class Notifier
extends java.lang.Object
implements java.lang.AutoCloseable
Constructor and Description |
---|
Notifier(java.lang.Runnable run)
Create a Notifier for timer event notification.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected void |
finalize() |
void |
setHandler(java.lang.Runnable handler)
Change the handler function.
|
void |
startPeriodic(double period)
Register for periodic event notification.
|
void |
startSingle(double delay)
Register for single event notification.
|
void |
stop()
Stop timer events from occurring.
|
public Notifier(java.lang.Runnable run)
run
- The handler that is called at the notification time which is set
using StartSingle or StartPeriodic.protected void finalize()
finalize
in class java.lang.Object
public void close()
close
in interface java.lang.AutoCloseable
public void setHandler(java.lang.Runnable handler)
handler
- Handlerpublic void startSingle(double delay)
delay
- Seconds to wait before the handler is called.public void startPeriodic(double period)
period
- Period in seconds to call the handler starting one period after
the call to this method.public void stop()