com.google.gwt.user.client
Class Timer

java.lang.Object
  extended bycom.google.gwt.user.client.Timer

public abstract class Timer
extends Object

A simplified, browser-safe timer class. This class serves the same purpose as java.util.Timer, but is simplified because of the single-threaded environment. To schedule a timer, simply create a subclass of it (overriding run()) and call schedule(long) or scheduleRepeating(long).

Example: code


Field Summary
 
Fields inherited from class java.lang.Object
typeId, typeName
 
Constructor Summary
Timer()
           
 
Method Summary
 void cancel()
          Cancels this timer.
abstract  void run()
          This method will be called when a timer fires.
 void schedule(long delayMillis)
          Schedules a timer to elapse in the future.
 void scheduleRepeating(long periodMillis)
          Schedules a timer that elapses repeatedly.
 
Methods inherited from class java.lang.Object
equals, finalize, hashCode, toString
 

Constructor Detail

Timer

public Timer()
Method Detail

cancel

public void cancel()
Cancels this timer.


run

public abstract void run()
This method will be called when a timer fires. Override it to implement the timer's logic.


schedule

public void schedule(long delayMillis)
Schedules a timer to elapse in the future.

Parameters:
delayMillis - how long to wait before the timer elapses, in milliseconds

scheduleRepeating

public void scheduleRepeating(long periodMillis)
Schedules a timer that elapses repeatedly.

Parameters:
periodMillis - how long to wait before the timer elapses, in milliseconds, between each repetition


This javadoc distribution was not produced by Google. The official documentation is here.