|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectTSim.SensorEvent
public class SensorEvent
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
|
static int |
INACTIVE
|
protected int |
status
|
protected int |
trainId
|
protected int |
xPos
|
protected int |
yPos
|
Constructor Summary | |
---|---|
SensorEvent(int trainId,
int xPos,
int yPos,
int status)
Creates a new SensorEvent for a specific train and sensor. |
Method Summary | |
---|---|
int |
getStatus()
Returns the status of the sensor; either ACTIVE or INACTIVE. |
int |
getTrainId()
Returns the id of the train affecting the sensor. |
int |
getXpos()
Returns the x coordinate of the affected sensor. |
int |
getYpos()
Returns theyx coordinate of the affected sensor. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int ACTIVE
public static final int INACTIVE
protected int trainId
protected int status
protected int xPos
protected int yPos
Constructor Detail |
---|
public SensorEvent(int trainId, int xPos, int yPos, int status)
trainId
- the id of the train passing the sensor.xPos
- the x coordinate of the sensor.yPos
- the y coordinate of the sensor.status
- the status of the sensor; either ACTIVE or INACTIVE/Method Detail |
---|
public int getXpos()
public int getYpos()
public int getStatus()
public int getTrainId()
public java.lang.String toString()
toString
in class java.lang.Object
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |