Qizx/open API

net.axyana.qizxopen.util
Class Timer

java.lang.Object
  extended byjava.lang.Thread
      extended bynet.axyana.qizxopen.util.Timer
All Implemented Interfaces:
java.lang.Runnable

public class Timer
extends java.lang.Thread

Timer event generator (supports simple one-shot alarms).


Nested Class Summary
static interface Timer.Handler
          Interface that must be implemented by timer-event targets.
static class Timer.Request
           
 
Field Summary
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Timer()
           
 
Method Summary
 Timer.Request newRequest(int duration, Timer.Handler handler)
          Arm a timer request with a duration and an event-handler.
static Timer.Request request(int duration, Timer.Handler handler)
          Static convenience.
 void run()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Timer

public Timer()
Method Detail

newRequest

public Timer.Request newRequest(int duration,
                                Timer.Handler handler)
Arm a timer request with a duration and an event-handler.

Parameters:
duration - in milliseconds.
handler - receiver of the timer event.
Returns:
the request descriptor (can be used for cancelling).

request

public static Timer.Request request(int duration,
                                    Timer.Handler handler)
Static convenience.


run

public void run()

© 2005 Axyana Software