Class TrainType


  • public class TrainType
    extends java.lang.Object
    Define the content of a Train Type record.
    • Constructor Summary

      Constructors 
      Constructor Description
      TrainType​(int layoutId)
      Create a new train type with default values.
      TrainType​(int typeId, int layoutId, java.lang.String typeName, java.lang.String typeColor)  
    • 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.
      • setTypeName

        public void setTypeName​(java.lang.String newName)
      • setTypeColor

        public void setTypeColor​(java.lang.String newColor)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object