Class Train

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

      • Train

        public Train​(int scheduleId)
        Create a new train with default values.
        scheduleId - The parent schedule id.
        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.
        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.
        a new Train instance.
      • setTypeId

        public void setTypeId​(int newType)
      • setTrainName

        public void setTrainName​(java.lang.String newName)
      • setTrainDesc

        public void setTrainDesc​(java.lang.String newDesc)
      • setStartTime

        public void setStartTime​(int newStartTime)
      • setThrottle

        public void setThrottle​(int newThrottle)
      • setTrainNotes

        public void setTrainNotes​(java.lang.String newNotes)
      • toString

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