Added getDelay()

This commit is contained in:
nathan 2014-11-03 02:13:37 +01:00
parent 576d0af40d
commit 17ff06d212
1 changed files with 8 additions and 2 deletions

View File

@ -11,10 +11,11 @@ public class DelayTimer {
}
private final String name;
private final boolean isDaemon;
private final Callback listener;
private volatile Timer timer;
private final boolean isDaemon;
private Timer timer;
private long delay;
public DelayTimer(Callback listener) {
this(null, true, listener);
@ -54,6 +55,7 @@ public class DelayTimer {
* @param delay milliseconds to wait
*/
public synchronized void delay(long delay) {
this.delay = delay;
cancel();
if (delay > 0) {
@ -76,4 +78,8 @@ public class DelayTimer {
this.timer = null;
}
}
public synchronized long getDelay() {
return this.delay;
}
}