edu.colorado.cs.ns2.sim
Class SimulationEvent

java.lang.Object
  extended by edu.colorado.cs.ns2.sim.SimulationEvent
All Implemented Interfaces:
java.io.Serializable

public class SimulationEvent
extends java.lang.Object
implements java.io.Serializable

This class encapsulates application events by providing a binding between an application, an event action, and an event time.

Author:
Kevin Bauer, Pushkar Sambhoos.
See Also:
Serialized Form

Field Summary
private  Application app
          The application on which this event should occur.
private static long serialVersionUID
          Generated serial version UID.
private  double simulationTime
          The time of this event in the simulation.
private  java.lang.String whatToDO
          The event action: {start, stop, finish}.
 
Constructor Summary
SimulationEvent()
          Default constructor.
SimulationEvent(double simulationTime, Application app, java.lang.String whatToDO)
          Three-argument constructor.
 
Method Summary
 Application getApp()
          Returns the Application.
 double getSimulationTime()
          Returns the simulation time when this event will be executed.
 java.lang.String getWhatToDO()
          Return the action that should be performed by the simulator.
 void setApp(Application app)
          Sets the Application.
 void setSimulationTime(double simulationTime)
          Set the simulation time when this event will be executed.
 void setWhatToDO(java.lang.String whatToDO)
          Set the event action.
 java.lang.String toString()
          A String representation of a SimulationEvent.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
Generated serial version UID.

See Also:
Constant Field Values

simulationTime

private double simulationTime
The time of this event in the simulation.


app

private Application app
The application on which this event should occur.


whatToDO

private java.lang.String whatToDO
The event action: {start, stop, finish}.

Constructor Detail

SimulationEvent

public SimulationEvent()
Default constructor.


SimulationEvent

public SimulationEvent(double simulationTime,
                       Application app,
                       java.lang.String whatToDO)
Three-argument constructor.

Parameters:
simulationTime - The event's time.
app - The Application on which the event should occur.
whatToDO - The event's action.
Method Detail

toString

public java.lang.String toString()
A String representation of a SimulationEvent.

Overrides:
toString in class java.lang.Object

getApp

public Application getApp()
Returns the Application.

Returns:

setApp

public void setApp(Application app)
Sets the Application.

Parameters:
app - A new Application.

getSimulationTime

public double getSimulationTime()
Returns the simulation time when this event will be executed.

Returns:
Time simulation time.

setSimulationTime

public void setSimulationTime(double simulationTime)
Set the simulation time when this event will be executed.

Parameters:
simulationTime - A new event execution time.

getWhatToDO

public java.lang.String getWhatToDO()
Return the action that should be performed by the simulator.

Returns:
The action that should be performed by the simulator.

setWhatToDO

public void setWhatToDO(java.lang.String whatToDO)
Set the event action.

Parameters:
whatToDO - A new event action.