|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objectwave.utility.Timer
This class is based upon an article in JavaWorld.
Nested Class Summary | |
static class |
Timer.Mode
Description of the Class |
static class |
Timer.Test
Test case. |
Field Summary | |
protected java.util.Hashtable |
assocation
|
static Timer.Mode |
CONTINUOUS
Description of the Field |
static java.lang.String |
EXPIRED
Description of the Field |
static long |
FOREVER
Description of the Field |
static Timer.Mode |
KEEPTHREAD
Description of the Field |
protected LockManager |
lockManager
|
static Timer.Mode |
RUNONCE
Description of the Field |
static java.lang.String |
STOPPED
Description of the Field |
Constructor Summary | |
Timer(java.awt.event.ActionListener l,
int delay)
Run the action listener on its own thread in delay amount of time. |
|
Timer(int delay)
Using this constructor is the same as Timer(delay, Timer.CONTINUOUS ); |
|
Timer(int delay,
Timer.Mode type)
|
Method Summary | |
void |
addActionListener(java.awt.event.ActionListener l)
Add an action listener to be notified at every clock tick. |
void |
finalize()
|
void |
flushQueue()
Stop notifying the action listeners with actionEvents. |
int |
getDelay()
The time between clock ticks. |
boolean |
isStopped()
|
boolean |
pause(long timeout)
Pause the current thread for at most timeout milliseconds. |
void |
removeActionListener(java.awt.event.ActionListener l)
|
int |
runningQueueSize()
An estimate of how many action listeners are have been notified, but have yet to execute. |
void |
setDelay(int val)
The time between clock ticks. |
void |
setEnableNotifications(boolean b)
|
void |
start()
Start the timer ticking. |
void |
stop()
Stop the timer from ticking. |
void |
waitForActionListeners()
Wait for all of the action listeners. |
boolean |
waitForTimer()
Go into an indefinite wait state until the clock timer ticks. |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected LockManager lockManager
protected java.util.Hashtable assocation
public static final Timer.Mode CONTINUOUS
public static final Timer.Mode RUNONCE
public static final Timer.Mode KEEPTHREAD
public static final java.lang.String STOPPED
public static final java.lang.String EXPIRED
public static final long FOREVER
Constructor Detail |
public Timer(int delay, Timer.Mode type)
delay
- int The time between clock ticks.type
- Description of Parameterpublic Timer(int delay)
delay
- Description of Parameter#Timer(int, Mode)
public Timer(java.awt.event.ActionListener l, int delay)
l
- The action listener upon which to invoke the command.delay
- The time in milliseconds to wait.Method Detail |
public void setDelay(int val)
val
- The new Delay valuepublic void setEnableNotifications(boolean b)
b
- The new EnableNotifications valuepublic boolean isStopped()
public int getDelay()
public void start()
stop()
public void stop()
public void finalize()
finalize
in class java.lang.Object
public boolean pause(long timeout)
timeout
- Description of Parameter
public boolean waitForTimer()
public void addActionListener(java.awt.event.ActionListener l)
l
- The feature to be added to the ActionListener attributeflushQueue()
,
runningQueueSize()
public void removeActionListener(java.awt.event.ActionListener l)
l
- Description of Parameterpublic int runningQueueSize()
public void flushQueue()
public void waitForActionListeners()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |