EspressReport
v 5.5

quadbase.chart.designer
Class Alarm

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--quadbase.chart.designer.Alarm
All Implemented Interfaces:
java.lang.Runnable

public class Alarm
extends java.lang.Thread

Class Alarm

Simple implementation of an alarm . It call back the owner of the alarm ( who implements the interface AlarmTarget ) after a fixed amount of time .

Default time delay is half a second .

The Alarm is a Thread of which the start() method should be invoked before the alarm is used . And one should stop the thread when the alarm is not going to be used anymore .

Version:
1.0 3-12-96
See Also:
AlarmTarget

Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Alarm(AlarmTarget at)
          Create an alarm without sleep time
Alarm(AlarmTarget at, long mills)
           
Alarm(AlarmTarget at, long mills, java.lang.ThreadGroup tg)
           
Alarm(long mills, AlarmTarget at)
          Create an alarm with sleep time
 
Method Summary
 void cancelSleep()
           
 void restart()
          Start the alarm , if previously started , it will start over again
 void restart(long mills)
          Start the alarm with a new time delay , if previously started , it will start over again
 void resumeAlarm()
           
 void run()
           
 void setPeriodic(boolean periodic)
          controls whether this alarm fires periodically or only once
 void setSleepTime(long mill)
          Set the sleepTime
 void suspendAlarm()
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Alarm

public Alarm(long mills,
             AlarmTarget at)
Create an alarm with sleep time
Parameters:
mill - sleeptime in milliseconds
at - the AlarmTarget

Alarm

public Alarm(AlarmTarget at,
             long mills)

Alarm

public Alarm(AlarmTarget at)
Create an alarm without sleep time
Parameters:
at - the AlarmTarget

Alarm

public Alarm(AlarmTarget at,
             long mills,
             java.lang.ThreadGroup tg)
Method Detail

setPeriodic

public void setPeriodic(boolean periodic)
controls whether this alarm fires periodically or only once
Parameters:
periodic - true for repetitive signals

setSleepTime

public void setSleepTime(long mill)
Set the sleepTime

restart

public void restart()
Start the alarm , if previously started , it will start over again

restart

public void restart(long mills)
Start the alarm with a new time delay , if previously started , it will start over again

cancelSleep

public void cancelSleep()

run

public void run()
Overrides:
run in class java.lang.Thread

suspendAlarm

public void suspendAlarm()

resumeAlarm

public void resumeAlarm()

EspressReport
v 5.5