se.lth.cs.realtime.event
Class PeriodicEvent

java.lang.Object
  extended byjava.util.EventObject
      extended byse.lth.cs.realtime.event.RTEvent
          extended byse.lth.cs.realtime.event.PeriodicEvent
All Implemented Interfaces:
java.io.Serializable

public class PeriodicEvent
extends RTEvent

Generic event used to trigger periodic activities in an event-driven fashion, as an alternative to using PeriodicThread which is time driven. Both RTThread and other subclasses are candidates for being triggered by PeriodicEvents, whenever based on externally triggered cyclic behavior. Some timer or periodic thread is needed for the generation of periodic events.

A PeriodicEvent has no owner. That is, owner is set to null, enabling the event to be sent over and over again from the same source. Subclasses are, however, free to assign ownership simply by assigning the (protected) owner field.

See Also:
License, PeriodicThread, Timer, RTEvent, Serialized Form

Field Summary
 
Fields inherited from class se.lth.cs.realtime.event.RTEvent
owner, ticker, timestamp
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
PeriodicEvent()
          Constructs an PeriodicEvent object with the current thread as source and a time stamp from the current system time.
PeriodicEvent(long ts)
          Constructs an PeriodicEvent object with the current thread as source and with the specified time stamp.
PeriodicEvent(java.lang.Object source)
          Constructs an PeriodicEvent object with the specified source object and a time stamp from the current system time.
PeriodicEvent(java.lang.Object source, long ts)
          Constructs an PeriodicEvent object with the specified source object and time stamp.
PeriodicEvent(java.lang.Object source, long ts, Timebase timebase)
          Constructs an PeriodicEvent object with the specified source object and time-stamp with respect to the specified time-base.
 
Methods inherited from class se.lth.cs.realtime.event.RTEvent
getMillis, getNanos, getOwner, getSeconds, getTicks, getTimebase, paramString, setOwner, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PeriodicEvent

public PeriodicEvent()
Constructs an PeriodicEvent object with the current thread as source and a time stamp from the current system time.


PeriodicEvent

public PeriodicEvent(long ts)
Constructs an PeriodicEvent object with the current thread as source and with the specified time stamp.

Parameters:
ts - The time from which the event originates.

PeriodicEvent

public PeriodicEvent(java.lang.Object source)
Constructs an PeriodicEvent object with the specified source object and a time stamp from the current system time.

Parameters:
source - The object where the event originated.

PeriodicEvent

public PeriodicEvent(java.lang.Object source,
                     long ts)
Constructs an PeriodicEvent object with the specified source object and time stamp.

Parameters:
source - The object where the event originated.
ts - The time from which the event originates.

PeriodicEvent

public PeriodicEvent(java.lang.Object source,
                     long ts,
                     Timebase timebase)
Constructs an PeriodicEvent object with the specified source object and time-stamp with respect to the specified time-base.

Parameters:
source - The object where the event originated.
ts - The time from which the event originates.