TSim
Class TrainEvent

java.lang.Object
  extended by TSim.TrainEvent
All Implemented Interfaces:
TSimInformation

public class TrainEvent
extends java.lang.Object
implements TSimInformation

An (erroneous) event for a train.


Field Summary
static int DERAILMENT
          Event type: Train has run off the rails.
static int STOP_COLLISION
          Event type: Train has collided with a stop at the end of the track.
static int TRAIN_COLLISION
          Event type: Train has collided with another train.
 
Constructor Summary
TrainEvent(int event)
          Create a new TrainEvent for the specified train id and with the specified event type.
 
Method Summary
 int getEvent()
          Returns the type of the event.
 java.lang.String toString()
          Returns a string representation of the event.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRAIN_COLLISION

public static final int TRAIN_COLLISION
Event type: Train has collided with another train.

See Also:
Constant Field Values

STOP_COLLISION

public static final int STOP_COLLISION
Event type: Train has collided with a stop at the end of the track.

See Also:
Constant Field Values

DERAILMENT

public static final int DERAILMENT
Event type: Train has run off the rails.

See Also:
Constant Field Values
Constructor Detail

TrainEvent

public TrainEvent(int event)
Create a new TrainEvent for the specified train id and with the specified event type.

Parameters:
event - the type of the event.
Method Detail

getEvent

public int getEvent()
Returns the type of the event.

Returns:
the type of the event.

toString

public java.lang.String toString()
Returns a string representation of the event. This is used when creating exception messages.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the event.