Package jmri.jmrit.timetable
Class TrainType
- java.lang.Object
-
- jmri.jmrit.timetable.TrainType
-
public class TrainType extends java.lang.Object
Define the content of a Train Type record.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) TimeTableDataManager_dm
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TrainTypegetCopy(int layoutId)Make a copy of the train type.intgetLayoutId()java.lang.StringgetTypeColor()intgetTypeId()java.lang.StringgetTypeName()voidsetTypeColor(java.lang.String newColor)voidsetTypeName(java.lang.String newName)java.lang.StringtoString()
-
-
-
Constructor Detail
-
TrainType
public TrainType(int layoutId)
Create a new train type with default values.- Parameters:
layoutId- The parent layout id.- Throws:
java.lang.IllegalArgumentException- TYPE_ADD_FAIL
-
TrainType
public TrainType(int typeId, int layoutId, java.lang.String typeName, java.lang.String typeColor)
-
-
Method Detail
-
getCopy
public TrainType getCopy(int layoutId)
Make a copy of the train type.- Parameters:
layoutId- The new layoutId, if zero use the current layout id.- Returns:
- a new train type instance.
-
getTypeId
public int getTypeId()
-
getLayoutId
public int getLayoutId()
-
getTypeName
public java.lang.String getTypeName()
-
setTypeName
public void setTypeName(java.lang.String newName)
-
getTypeColor
public java.lang.String getTypeColor()
-
setTypeColor
public void setTypeColor(java.lang.String newColor)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-