Package org.pepstock.charba.client.utils
Class CTimer
- java.lang.Object
- 
- org.pepstock.charba.client.utils.CTimer
 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classCTimer.StatusEnumerates the possible status of the timer.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetInterval()Returns the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.CTimer.StatusgetStatus()Returns the status of the timer.voidstart()Starts the timer which executes repeatedly calls.voidstart(int interval)Starts the timer which executes repeatedly calls, setting the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.
 The time will override the previous interval time.voidstop()Stops the timer which is currently running.
 
- 
- 
- 
Constructor Detail- 
CTimerpublic CTimer(Runnable task, int interval) Creates the timer with aRunnableto be executed repeatedly and the time, in milliseconds (thousands of a second), the timer should delay in between executions of the task.- Parameters:
- task- the task to be executed repeatedly
- interval- the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.
 Must be greater than 0.
 
 
- 
 - 
Method Detail- 
getIntervalpublic int getInterval() Returns the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.- Returns:
- the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task
 
 - 
getStatuspublic CTimer.Status getStatus() Returns the status of the timer.- Returns:
- the status of the timer
 
 - 
startpublic void start(int interval) Starts the timer which executes repeatedly calls, setting the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.
 The time will override the previous interval time.- Parameters:
- interval- the time, in milliseconds (thousands of a second), the timer should delay in between executions of the specified task.
 Must be greater than 0.
 
 - 
startpublic void start() Starts the timer which executes repeatedly calls.
 - 
stoppublic void stop() Stops the timer which is currently running.
 
- 
 
-