Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

edu.emory.mathcs.util.concurrent
Class AlarmClock  view AlarmClock download AlarmClock.java

java.lang.Object
  extended byedu.emory.mathcs.util.concurrent.AlarmClock

public class AlarmClock
extends java.lang.Object

This class provide some value-added over java.util.Timer: that is, it enables rescheduling of previously scheduled tasks.

Version:
1.0

Field Summary
(package private)  java.util.Timer engine
           
(package private)  java.lang.Runnable task
           
(package private)  java.util.TimerTask timerTask
           
 
Constructor Summary
AlarmClock(java.util.Timer engine, java.lang.Runnable task)
           
 
Method Summary
 boolean cancel()
          Cancel the scheduled task.
 boolean setAlarmDelay(long delay)
          Reschedule previously scheduled task.
 void setAlarmDelayIfSooner(long delay)
          Reschedule previously scheduled task unless it would postpone it.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

engine

final java.util.Timer engine

task

final java.lang.Runnable task

timerTask

java.util.TimerTask timerTask
Constructor Detail

AlarmClock

public AlarmClock(java.util.Timer engine,
                  java.lang.Runnable task)
Method Detail

setAlarmDelayIfSooner

public void setAlarmDelayIfSooner(long delay)
Reschedule previously scheduled task unless it would postpone it. In other words, if the requested delay is longer than the time remaining until the previously scheduled execution, the request is ignored.


setAlarmDelay

public boolean setAlarmDelay(long delay)
Reschedule previously scheduled task.


cancel

public boolean cancel()
Cancel the scheduled task.