All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.sun.util.PTimer

java.lang.Object
   |
   +----com.sun.util.PTimer

public abstract class PTimer
extends Object
A class representing a timer. A timer is responsible for managing a set of timer events specified by timer specifications. When the timer event should be sent, the timer calls the timer specification's notifyListeners method.


Constructor Index

 o PTimer()

Method Index

 o deschedule(PTimerSpec)
Removes a timer specification from the set of monitored specifications.
 o getTimer()
Returns the default timer for the system.
 o schedule(PTimerSpec)
Begins monitoring a PTimerSpec.

Constructors

 o PTimer
 public PTimer()

Methods

 o getTimer
 public static PTimer getTimer()
Returns the default timer for the system. There may be one PTimer instance per virtual machine, one per applet, one per call to getTimer, or some other platform dependent implementation.

Returns:
A non-null PTimer object.
 o schedule
 public abstract void schedule(PTimerSpec t)
Begins monitoring a PTimerSpec.

When the timer specification should go off, the timer will call PTimerSpec.notifyListeners. If you schedule an absolute specification that should have gone off already, it will go off immediately.

You may schedule a timer specification with multiple timers. You may schedule a timer specification with the same timer multiple times (in which case it will go off multiple times). If you modify a timer specification after it has been scheduled with any timer, the results are unspecified.

Parameters:
t - The timer specification to begin monitoring.
 o deschedule
 public abstract void deschedule(PTimerSpec t)
Removes a timer specification from the set of monitored specifications. The descheduling happens as soon as practical, but may not happen immediately. If the timer specification has been scheduled multiple times with this timer, all the schedulings are cancelled.


All Packages  Class Hierarchy  This Package  Previous  Next  Index