simulation_Lab06Version
Class Observee

java.lang.Object
  extended by simulation_Lab06Version.Observee

public class Observee
extends Object

This class encapsulates services for launching a new thread and for starting a process on that thread that dispatches events at the specified rate. Objects of this type can support a single observer (additional observers cannot be installed).

Author:
mb

Constructor Summary
Observee(int numberEventsToBeDispatchedPerSecond, ActionListener theObserver)
          Instantiates an object that dispatches events and that can be observed (an observee).
 
Method Summary
 boolean isRunning()
          Determines whether this Observee is currently running and dispatching events.
 void start()
          Launches the thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Observee

public Observee(int numberEventsToBeDispatchedPerSecond,
                ActionListener theObserver)
Instantiates an object that dispatches events and that can be observed (an observee).

Parameters:
numberEventsToBeDispatchedPerSecond - an int that is strictly greater than zero, representing the number of events to be dispatched per second
theObserver - the object that will be listening for the events dispatched by this object
Method Detail

start

public void start()
Launches the thread.


isRunning

public boolean isRunning()
Determines whether this Observee is currently running and dispatching events.

Returns:
as described above