fang
Interface AlarmScheduler

All Known Implementing Classes:
FrameAdvancer, Game, GameLoop, GameRedirection

public interface AlarmScheduler

This interface contains all of the methods for scheduling and cancelling alarms. The FrameAdvancer implements this interface, and by extension, so too does the GameLoop and GameLevel.

Author:
Jam Jenkins

Method Summary
 void cancelAlarm(Alarm alarm)
          removes all pending alarms on this object.
 void cancelAllAlarms()
          removes all pending alarms.
 void scheduleAbsolute(Alarm alarm, double absolute)
          sets and alarm to go off at a time relative to the beginning of time (zero).
 void scheduleRelative(Alarm alarm, double relative)
          sets and alarm to go off relative to the current time.
 

Method Detail

scheduleRelative

void scheduleRelative(Alarm alarm,
                      double relative)
sets and alarm to go off relative to the current time. For example, this method can be used to set off an alarm in 5 seconds from the current time.

Parameters:
alarm - the class to call the alarm method on
relative - the time from now in seconds to call the alarm method

scheduleAbsolute

void scheduleAbsolute(Alarm alarm,
                      double absolute)
sets and alarm to go off at a time relative to the beginning of time (zero). For example, this method can be used to set off an alarm 30 seconds from the beginning time.

Parameters:
alarm - the class to call the alarm method on
absolute - the time in seconds to call the alarm method

cancelAlarm

void cancelAlarm(Alarm alarm)
removes all pending alarms on this object. If there are no alarms with this object as the target, the method call is ignored.

Parameters:
alarm - the object that is the target of a pending alarm

cancelAllAlarms

void cancelAllAlarms()
removes all pending alarms. If there are no pending alarms, the method call is ignored.