|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--org.opendoors.util.Timer
This class provides timer and supporting events to client objects by extending the Observable base class. Clients get notifications of changes in the clock.
The interval for firing changes to observers is resetable in the event the observer needs more frequent updates of changes.
The instance may be a one shot timer as well as a recurring timers. This supports a one shot notification in the future.
Observable is thread-safe and supports multiple listeners to a single observable such as an observable which fires every 24 hours.
Constructor Summary | |
Timer()
Public constructor to create a timer event source using factory defaults which are 1 second timer, recurring. |
|
Timer(java.lang.String name,
int period,
boolean oneShot)
Construct a timer with the certain properties set. |
Method Summary | |
java.lang.String |
getName()
Gets the name of the timer. |
int |
getPeriod()
Gets the period between timer events. |
boolean |
isOneShot()
Interrogates if this is a one-shot operation. |
void |
run()
Run the timer. |
void |
setName(java.lang.String n)
Sets the name of the timer. |
void |
setOneShot(boolean os)
Set this object to be one-shot or not. |
void |
setPeriod(int p)
Sets the period in milliseconds. |
void |
stop()
Stop the timer |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Timer()
public Timer(java.lang.String name, int period, boolean oneShot)
The
- name of the timer.The
- period in milliseconds.True
- if this is a oneShot instanceMethod Detail |
public void stop()
public java.lang.String getName()
public void setName(java.lang.String n)
The
- textual name.public int getPeriod()
public void setPeriod(int p)
The
- interval.public boolean isOneShot()
public void setOneShot(boolean os)
True,
- if one-shot operation desiredpublic void run()
run
in interface java.lang.Runnable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |