Added getDelay()
This commit is contained in:
parent
576d0af40d
commit
17ff06d212
|
@ -11,10 +11,11 @@ public class DelayTimer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
|
private final boolean isDaemon;
|
||||||
private final Callback listener;
|
private final Callback listener;
|
||||||
|
|
||||||
private volatile Timer timer;
|
private Timer timer;
|
||||||
private final boolean isDaemon;
|
private long delay;
|
||||||
|
|
||||||
public DelayTimer(Callback listener) {
|
public DelayTimer(Callback listener) {
|
||||||
this(null, true, listener);
|
this(null, true, listener);
|
||||||
|
@ -54,6 +55,7 @@ public class DelayTimer {
|
||||||
* @param delay milliseconds to wait
|
* @param delay milliseconds to wait
|
||||||
*/
|
*/
|
||||||
public synchronized void delay(long delay) {
|
public synchronized void delay(long delay) {
|
||||||
|
this.delay = delay;
|
||||||
cancel();
|
cancel();
|
||||||
|
|
||||||
if (delay > 0) {
|
if (delay > 0) {
|
||||||
|
@ -76,4 +78,8 @@ public class DelayTimer {
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public synchronized long getDelay() {
|
||||||
|
return this.delay;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user