public abstract class TimerLoop extends Object
| Constructor and Description |
|---|
TimerLoop(long interval)
Creates a new TimerLoop with the given interval in milliseconds.
|
| Modifier and Type | Method and Description |
|---|---|
long |
getIntervalLength()
Returns the interval length.
|
void |
setIntervalLength(long interval)
Sets the interval length.
|
void |
start()
Start performing the action at intervals.
|
void |
stop()
Stop the timer.
|
protected abstract void |
timerTick(long time,
long interval)
Action to perform at regular intervals.
|
public TimerLoop(long interval)
interval - number of milliseconds between performing the actionpublic void setIntervalLength(long interval)
interval - number of milliseconds between performing the actionpublic long getIntervalLength()
protected abstract void timerTick(long time,
long interval)
time - current timeinterval - length of the timer intervalpublic void start()
public void stop()
Copyright © 2011-2014. All Rights Reserved.