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 TrainType
getCopy(int layoutId)
Make a copy of the train type.int
getLayoutId()
java.lang.String
getTypeColor()
int
getTypeId()
java.lang.String
getTypeName()
void
setTypeColor(java.lang.String newColor)
void
setTypeName(java.lang.String newName)
java.lang.String
toString()
-
-
-
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:
toString
in classjava.lang.Object
-
-