TSim
Class SensorEvent

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

public class SensorEvent
extends java.lang.Object
implements TSimInformation

SensorEvent represents the event of a train passing over a sensor. Every time a train passes over a sensor first an ACTIVE event is created followed by an INACTIVE event when the train leaves the sensor.


Field Summary
static int ACTIVE
          Sensor event type: leading end of train has hit sensor.
static int INACTIVE
          Sensor event type: trailing end of train has left sensor.
 
Method Summary
 int getStatus()
          Returns the status of the sensor; either ACTIVE or INACTIVE.
 int getXpos()
          Returns the x coordinate of the affected sensor.
 int getYpos()
          Returns the y coordinate of the affected sensor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ACTIVE

public static final int ACTIVE
Sensor event type: leading end of train has hit sensor.

See Also:
Constant Field Values

INACTIVE

public static final int INACTIVE
Sensor event type: trailing end of train has left sensor.

See Also:
Constant Field Values
Method Detail

getXpos

public int getXpos()
Returns the x coordinate of the affected sensor.

Returns:
the x coordinate of the affected sensor.

getYpos

public int getYpos()
Returns the y coordinate of the affected sensor.

Returns:
the y coordinate of the affected sensor.

getStatus

public int getStatus()
Returns the status of the sensor; either ACTIVE or INACTIVE.

Returns:
the status of the sensor.