TSim
Class TrainErrorEvent

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

public class TrainErrorEvent
extends java.lang.Object
implements TSimInformation

Class representing an (erroneous) event for a train.


Field Summary
static int DERAILMENT
           
protected  int event
           
static int STOP_COLLISION
           
static int TRAIN_COLLISION
           
protected  int trainId
           
 
Constructor Summary
TrainErrorEvent(int trainId, int event)
          Creates a new TrainErrorEvent for the specified train id and with the specified event type.
 
Method Summary
 int getEvent()
          Returns the type of the event.
 int getTrainId()
          Returns the id of the train affected byt 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
See Also:
Constant Field Values

STOP_COLLISION

public static final int STOP_COLLISION
See Also:
Constant Field Values

DERAILMENT

public static final int DERAILMENT
See Also:
Constant Field Values

event

protected int event

trainId

protected int trainId
Constructor Detail

TrainErrorEvent

public TrainErrorEvent(int trainId,
                       int event)
Creates a new TrainErrorEvent for the specified train id and with the specified event type.

Parameters:
trainId - the id of the train affected by the event.
event - the type of the event.
Method Detail

getEvent

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

Returns:
the type of the event.

getTrainId

public int getTrainId()
Returns the id of the train affected byt the event.

Returns:
the id of the train effected by 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.