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 TraingetCopy(int schedId, int typeId)Make a copy of the train.intgetDefaultSpeed()intgetRouteDuration()intgetScheduleId()intgetStartTime()intgetThrottle()java.lang.StringgetTrainDesc()intgetTrainId()java.lang.StringgetTrainName()java.lang.StringgetTrainNotes()intgetTypeId()voidsetDefaultSpeed(int newSpeed)voidsetRouteDuration(int newRouteDuration)voidsetStartTime(int newStartTime)voidsetThrottle(int newThrottle)voidsetTrainDesc(java.lang.String newDesc)voidsetTrainName(java.lang.String newName)voidsetTrainNotes(java.lang.String newNotes)voidsetTypeId(int newType)java.lang.StringtoString()
-
-
-
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:
toStringin classjava.lang.Object
-
-