|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjmce.util.Timer
public class Timer
Asyncronous timer.
Every timer require a TimerManager to manage the timer queue.
Static method are provided to access a standard TimerManager for milliseconds based Timer.
TimerManager
Field Summary | |
---|---|
static int |
CANCELLED
|
static int |
IDLE
|
static int |
QUEUED
|
static int |
READY
|
Constructor Summary | |
---|---|
Timer(int time,
boolean repeat,
TimerListener run)
Standard constructor. |
|
Timer(int time,
TimerListener run)
Constructor without the repeat flag. |
Method Summary | |
---|---|
static void |
addTimer(Timer timer)
Add the timer to the standard TimerManager |
void |
cancel()
Cancel the timer. |
static Timer |
createTimer(int time,
boolean repeat,
TimerListener run)
Create a timer and add it to the standard milliseconds based TimerManager |
static Timer |
createTimer(int time,
TimerListener run)
Create a timer and add it to the standard TimerManager |
int |
getStatus()
Return the status of the timer |
long |
getTime()
Return the time |
boolean |
isRepeat()
Return the repeart flag. |
boolean |
isRunning()
Return true if the timer is active |
static void |
main(java.lang.String[] argv)
Main method for simple test |
void |
setRepeat(boolean mode)
Set the repeat flag |
void |
setTime(int t)
Set the time |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int IDLE
public static final int QUEUED
public static final int READY
public static final int CANCELLED
Constructor Detail |
---|
public Timer(int time, boolean repeat, TimerListener run)
Create a new time with specified time and repeat.
time
- - Time when it will expire.repeat
- - True if the timer must be repeatedrun
- - Listener to be called.public Timer(int time, TimerListener run)
Method Detail |
---|
public boolean isRunning()
public final boolean isRepeat()
public void setRepeat(boolean mode)
public long getTime()
public void setTime(int t)
public final void cancel()
Remove the timer from the TimerManager if queude else do nothing.
public final int getStatus()
public static void addTimer(Timer timer)
public static Timer createTimer(int time, boolean repeat, TimerListener run)
public static Timer createTimer(int time, TimerListener run)
public static void main(java.lang.String[] argv)
public java.lang.String toString()
toString
in class java.lang.Object
|
jmce - 1_02 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |