com.hardcode.gdbms.engine.internalExceptions
Class Timer

java.lang.Object
  extended by com.hardcode.gdbms.engine.internalExceptions.Timer

public class Timer
extends java.lang.Object

Reseteable timer. After a cancelTimer or after the execution of the scheduled task the object becomes unuseful: It's not possible to schedule more tasks

Author:
Fernando González Cortés

Nested Class Summary
 class Timer.TimerThread
          timer thread
 
Constructor Summary
Timer()
           
 
Method Summary
 void cancelTimer()
          cancels the timer.
 void resetTimer()
          restarts the timer
 void schedule(Task task, long delay)
          schedules a task
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Method Detail

schedule

public void schedule(Task task,
                     long delay)
schedules a task

Parameters:
task - task to schedule
delay - delay in milliseconds

resetTimer

public void resetTimer()
restarts the timer


cancelTimer

public void cancelTimer()
cancels the timer. It causes the timer to be unuseful. After this call you cannot schedule more tasks



Copyright © 2005-2006 . All Rights Reserved.