edu.umd.cs.piccolox.swt
Class SWTTimerQueue

java.lang.Object
  extended by edu.umd.cs.piccolox.swt.SWTTimerQueue
All Implemented Interfaces:
java.lang.Runnable

public class SWTTimerQueue
extends java.lang.Object
implements java.lang.Runnable

Author:
Lance Good

Nested Class Summary
protected static class SWTTimerQueue.SWTTimerQueueRestart
          Runnable that will message the shared instance of the Timer Queue to restart.
 
Field Summary
(package private)  org.eclipse.swt.widgets.Display display
           
(package private)  SWTTimer firstTimer
           
(package private) static SWTTimerQueue instance
           
(package private)  boolean running
           
 
Constructor Summary
SWTTimerQueue(org.eclipse.swt.widgets.Display display)
          Constructor for TimerQueue.
 
Method Summary
(package private)  void addTimer(SWTTimer timer, long expirationTime)
           
(package private)  boolean containsTimer(SWTTimer timer)
           
(package private)  long postExpiredTimers()
          If there are a ton of timers, this method may never return.
(package private)  void removeTimer(SWTTimer timer)
           
 void run()
           
static SWTTimerQueue sharedInstance(org.eclipse.swt.widgets.Display display)
           
(package private)  void start()
           
(package private)  void stop()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

instance

static SWTTimerQueue instance

display

org.eclipse.swt.widgets.Display display

firstTimer

SWTTimer firstTimer

running

boolean running
Constructor Detail

SWTTimerQueue

public SWTTimerQueue(org.eclipse.swt.widgets.Display display)
Constructor for TimerQueue.

Method Detail

sharedInstance

public static SWTTimerQueue sharedInstance(org.eclipse.swt.widgets.Display display)

start

void start()

stop

void stop()

addTimer

void addTimer(SWTTimer timer,
              long expirationTime)

removeTimer

void removeTimer(SWTTimer timer)

containsTimer

boolean containsTimer(SWTTimer timer)

postExpiredTimers

long postExpiredTimers()
If there are a ton of timers, this method may never return. It loops checking to see if the head of the Timer list has expired. If it has, it posts the Timer and reschedules it if necessary.


run

public void run()
Specified by:
run in interface java.lang.Runnable

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object