|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectproper.util.Timer
public class Timer
A simple wrapper for Timer-Events, listeners must implement the TimerInterface.
TimerInterface
Field Summary | |
---|---|
static int |
INTERVAL
the standard time in msec |
Constructor Summary | |
---|---|
Timer()
initializes the timer with standard time in msec and repeated events |
|
Timer(int interval)
initializes the timer with the given time in msec and repeated events |
|
Timer(int interval,
boolean repeated)
initializes the timer with the given time in msec and whether it fires only once or on a regular basis |
|
Timer(int interval,
boolean repeated,
boolean start)
initializes the timer with the given time in msec and whether it fires only once or on a regular basis, with start you can say whether it should start immediately |
Method Summary | |
---|---|
void |
addListener(TimerInterface o)
adds the object to the listener list |
void |
clear()
removes all the listeners and stops the timer |
int |
getInterval()
returns the current timer interval (in msec) |
java.util.Vector |
getListeners()
returns the current list of listeners |
boolean |
isRepeated()
whether the timer is firing on a regular basis |
boolean |
isRunning()
returns whether the timer is running |
void |
notifyListener(TimerInterface o)
notifies the specified listener of the timer event |
void |
notifyListeners()
notifies all the listeners of the timer event |
void |
removeListener(TimerInterface o)
removes the object from the listeners |
void |
setInterval(int interval)
sets the new timer interval (in msec) |
void |
setRepeated(boolean repeated)
sets whether the timer is firing regularly or not |
void |
start()
starts the timer |
void |
stop()
stops the timer |
java.lang.String |
toString()
this timer in a string representation |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int INTERVAL
Constructor Detail |
---|
public Timer()
INTERVAL
public Timer(int interval)
public Timer(int interval, boolean repeated)
public Timer(int interval, boolean repeated, boolean start)
Method Detail |
---|
public void clear()
public void addListener(TimerInterface o)
public void removeListener(TimerInterface o)
public java.util.Vector getListeners()
public void notifyListener(TimerInterface o)
public void notifyListeners()
public void start()
public void stop()
public boolean isRunning()
public void setInterval(int interval)
public int getInterval()
public void setRepeated(boolean repeated)
public boolean isRepeated()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |