Class Schedule

    • Constructor Detail

      • Schedule

        public Schedule​(java.lang.String id,
                        java.lang.String name)
      • Schedule

        public Schedule​(org.jdom2.Element e)
        Construct this Entry from XML. This member has to remain synchronized with the detailed DTD in operations-config.xml
        Parameters:
        e - Consist XML element
    • Method Detail

      • getId

        public java.lang.String getId()
      • setName

        public void setName​(java.lang.String name)
      • toString

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

        public java.lang.String getName()
      • setComment

        public void setComment​(java.lang.String comment)
      • getComment

        public java.lang.String getComment()
      • addItem

        public ScheduleItem addItem​(java.lang.String type)
        Adds a car type to the end of this schedule
        Parameters:
        type - The string car type to add.
        Returns:
        ScheduleItem created for the car type added
      • addItem

        public ScheduleItem addItem​(java.lang.String carType,
                                    int sequence)
        Add a schedule item at a specific place (sequence) in the schedule Allowable sequence numbers are 0 to max size of schedule. 0 = start of list.
        Parameters:
        carType - The string car type name to add.
        sequence - Where in the schedule to add the item.
        Returns:
        schedule item
      • register

        public void register​(ScheduleItem si)
        Remember a NamedBean Object created outside the manager.
        Parameters:
        si - The schedule item to add.
      • deleteItem

        public void deleteItem​(ScheduleItem si)
        Delete a ScheduleItem
        Parameters:
        si - The scheduleItem to delete.
      • getItemByType

        public ScheduleItem getItemByType​(java.lang.String carType)
        Get item by car type (gets last schedule item with this type)
        Parameters:
        carType - The string car type to search for.
        Returns:
        schedule item
      • getItemById

        public ScheduleItem getItemById​(java.lang.String id)
        Get a ScheduleItem by id
        Parameters:
        id - The string id of the ScheduleItem.
        Returns:
        schedule item
      • getItemsBySequenceList

        public java.util.List<ScheduleItemgetItemsBySequenceList()
        Get a list of ScheduleItems sorted by schedule order
        Returns:
        list of ScheduleItems ordered by sequence
      • moveItemUp

        public void moveItemUp​(ScheduleItem si)
        Places a ScheduleItem earlier in the schedule
        Parameters:
        si - The ScheduleItem to move.
      • moveItemDown

        public void moveItemDown​(ScheduleItem si)
        Places a ScheduleItem later in the schedule
        Parameters:
        si - The ScheduleItem to move.
      • checkScheduleValid

        public java.lang.String checkScheduleValid​(Track track)
        Check to see if schedule is valid for the track.
        Parameters:
        track - The track associated with this schedule
        Returns:
        SCHEDULE_OKAY if schedule okay, otherwise an error message.
      • checkScheduleAttribute

        public boolean checkScheduleAttribute​(java.lang.String attribute,
                                              java.lang.String carType,
                                              Car car)
      • store

        public org.jdom2.Element store()
        Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-config.xml.
        Returns:
        Contents in a JDOM Element
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent e)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener
      • setDirtyAndFirePropertyChange

        protected void setDirtyAndFirePropertyChange​(java.lang.String p,
                                                     java.lang.Object old,
                                                     java.lang.Object n)