Package jmri.jmrit.timetable
Class Train
- java.lang.Object
-
- jmri.jmrit.timetable.Train
-
public class Train extends java.lang.Object
Define the content of a Train record.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TimeTableDataManager
_dm
-
Constructor Summary
Constructors Constructor Description Train(int scheduleId)
Create a new train with default values.Train(int trainId, int scheduleId, int typeId, java.lang.String trainName, java.lang.String trainDesc, int defaultSpeed, int startTime, int throttle, int routeDuration, java.lang.String trainNotes)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Train
getCopy(int schedId, int typeId)
Make a copy of the train.int
getDefaultSpeed()
int
getRouteDuration()
int
getScheduleId()
int
getStartTime()
int
getThrottle()
java.lang.String
getTrainDesc()
int
getTrainId()
java.lang.String
getTrainName()
java.lang.String
getTrainNotes()
int
getTypeId()
void
setDefaultSpeed(int newSpeed)
void
setRouteDuration(int newRouteDuration)
void
setStartTime(int newStartTime)
void
setThrottle(int newThrottle)
void
setTrainDesc(java.lang.String newDesc)
void
setTrainName(java.lang.String newName)
void
setTrainNotes(java.lang.String newNotes)
void
setTypeId(int newType)
java.lang.String
toString()
-
-
-
Constructor Detail
-
Train
public Train(int scheduleId)
Create a new train with default values.- Parameters:
scheduleId
- The parent schedule id.- Throws:
java.lang.IllegalArgumentException
- TRAIN_ADD_FAIL
-
Train
public Train(int trainId, int scheduleId, int typeId, java.lang.String trainName, java.lang.String trainDesc, int defaultSpeed, int startTime, int throttle, int routeDuration, java.lang.String trainNotes)
-
-
Method Detail
-
getCopy
public Train getCopy(int schedId, int typeId)
Make a copy of the train.- Parameters:
schedId
- The new schedule id, if zero use the current schedule id.typeId
- The new train type id. If zero use the current train type id.- Returns:
- a new Train instance.
-
getTrainId
public int getTrainId()
-
getScheduleId
public int getScheduleId()
-
getTypeId
public int getTypeId()
-
setTypeId
public void setTypeId(int newType)
-
getTrainName
public java.lang.String getTrainName()
-
setTrainName
public void setTrainName(java.lang.String newName)
-
getTrainDesc
public java.lang.String getTrainDesc()
-
setTrainDesc
public void setTrainDesc(java.lang.String newDesc)
-
getDefaultSpeed
public int getDefaultSpeed()
-
setDefaultSpeed
public void setDefaultSpeed(int newSpeed)
-
getStartTime
public int getStartTime()
-
setStartTime
public void setStartTime(int newStartTime)
-
getThrottle
public int getThrottle()
-
setThrottle
public void setThrottle(int newThrottle)
-
getRouteDuration
public int getRouteDuration()
-
setRouteDuration
public void setRouteDuration(int newRouteDuration)
-
getTrainNotes
public java.lang.String getTrainNotes()
-
setTrainNotes
public void setTrainNotes(java.lang.String newNotes)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-