Valescom Java API

com.valescom.support.timer.java
Class Timer

java.lang.Object
  |
  +--com.valescom.support.event.java.EventHandler
        |
        +--com.valescom.support.timer.java.Timer
Direct Known Subclasses:
OneShotTimer, PeriodicTimer

public abstract class Timer
extends EventHandler

Responsibility:
Providing an abstract base class for OneShotTimer and PeriodicTimer.
States:
Started, the Timer is running.
Stopped, the Timer does not go off.

 

Constructor Summary
protected Timer(int anInterval)
           
 
Method Summary
 long delay()
          Before an EventHandler is handled by the EventDispatcher, the delay is set.
 int interval()
           
 void interval(int anInterval)
           
 boolean isStarted()
          Indicates whether this EventHandler is started or not.
protected  void register()
           
 void restart()
           
 void start()
          Start this EventHandler if it has not already been started.
 void stop()
          Stop this EventHandler if it has not already been stopped.
 Subscription subscription()
          Returns the subscription for which this is a EventHandler.
protected  void timeout()
           
protected  void unregister()
           
 
Methods inherited from class com.valescom.support.event.java.EventHandler
handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Timer

protected Timer(int anInterval)
Method Detail

restart

public final void restart()

interval

public final int interval()

interval

public final void interval(int anInterval)

isStarted

public final boolean isStarted()
Description copied from class: EventHandler
Indicates whether this EventHandler is started or not.

Pre conditions:
theHandler may not be null.

Overrides:
isStarted in class EventHandler
Returns:
true if started, otherwise false.

start

public final void start()
Description copied from class: EventHandler
Start this EventHandler if it has not already been started.

Pre conditions:
theHandler may not be null.

Overrides:
start in class EventHandler

stop

public final void stop()
Description copied from class: EventHandler
Stop this EventHandler if it has not already been stopped.

Pre conditions:
theHandler may not be null.

Overrides:
stop in class EventHandler

delay

public final long delay()
Description copied from class: EventHandler
Before an EventHandler is handled by the EventDispatcher, the delay is set. This way, inside the handle() method, an application has a notice of the delay of the event (The HandleTime - PublicationTime).

Pre conditions:
theHandler may not be null.

Overrides:
delay in class EventHandler

subscription

public final Subscription subscription()
Description copied from class: EventHandler
Returns the subscription for which this is a EventHandler.

Pre conditions:
theHandler may not be null.

Overrides:
subscription in class EventHandler
Returns:
The subscription.

timeout

protected void timeout()

register

protected final void register()

unregister

protected final void unregister()

Valescom Java API

Copyright 1998, 2003 - Valescom