Package zmq.util
Class Timers.Timer
- java.lang.Object
-
- zmq.util.Timers.Timer
-
- Enclosing class:
- Timers
public static final class Timers.Timer extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description private
Timer(Timers parent, long interval, Timers.Handler handler, java.lang.Object... args)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
cancel()
Cancels a timer.boolean
reset()
Reset the timer.boolean
setInterval(long interval)
Changes the interval of the timer.
-
-
-
Field Detail
-
parent
private final Timers parent
-
interval
private long interval
-
alive
private boolean alive
-
handler
private final Timers.Handler handler
-
args
private final java.lang.Object[] args
-
-
Constructor Detail
-
Timer
private Timer(Timers parent, long interval, Timers.Handler handler, java.lang.Object... args)
-
-
Method Detail
-
setInterval
public boolean setInterval(long interval)
Changes the interval of the timer. This method is slow, canceling existing and adding a new timer yield better performance.- Parameters:
interval
- the new interval of the timer.- Returns:
- true if set, otherwise false.
-
reset
public boolean reset()
Reset the timer. This method is slow, canceling existing and adding a new timer yield better performance.- Returns:
- true if reset, otherwise false.
-
cancel
public boolean cancel()
Cancels a timer.- Returns:
- true if cancelled, otherwise false.
-
-