Package org.csstudio.opibuilder.util
Class OPITimer
java.lang.Object
org.csstudio.opibuilder.util.OPITimer
A customized timer for the internal use of OPI builder. It will execute a task after certain delay. The timer can be
reseted or stopped during the delay period. The timer will stop and dispose automatically when it is due.
|------------|---------------| Start Due/start task task done
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
OPITimer
public OPITimer()
-
-
Method Details
-
start
Schedules the specified task for execution after the specified delay.- Parameters:
task
- task to be scheduled.delay
- delay in milliseconds before task is to be executed.- Throws:
IllegalArgumentException
- ifdelay
is negative, ordelay + System.currentTimeMillis()
is negative.IllegalStateException
- if task was already scheduled or canceled, or timer was canceled.
-
reset
public void reset()Reset the timer to start from zero again. -
isDue
public boolean isDue()- Returns:
- true if timer is due
-
stop
public void stop()Stop the timer. Cancel the scheduled task.
-