Class EngineManager

    • Method Detail

      • newRS

        public Engine newRS​(java.lang.String engineRoad,
                            java.lang.String engineNumber)
        Finds an existing engine or creates a new engine if needed requires engine's road and number
        Specified by:
        newRS in class RollingStockManager<Engine>
        Parameters:
        engineRoad - The engine's road initials
        engineNumber - The engine's road number
        Returns:
        new engine or existing engine
      • getByModelList

        public java.util.List<EnginegetByModelList()
        Sort by engine model
        Returns:
        list of engines ordered by engine model
      • getByConsistList

        public java.util.List<EnginegetByConsistList()
        Sort by engine consist
        Returns:
        list of engines ordered by engine consist
      • getAvailableTrainList

        public java.util.List<EnginegetAvailableTrainList​(Train train)
        return a list available engines (no assigned train) engines are ordered least recently moved to most recently moved.
        Parameters:
        train - The Train requesting this list.
        Returns:
        Ordered list of engines not assigned to a train
      • getByTrainBlockingList

        public java.util.List<EnginegetByTrainBlockingList​(Train train)
        Returns a list of locos sorted by blocking number for a train. This returns a list of consisted locos in the order that they were entered in.
        Parameters:
        train - The Train requesting this list.
        Returns:
        A list of sorted locos.
      • getEngineRoadNames

        public java.util.List<java.lang.String> getEngineRoadNames​(java.lang.String model)
        Get a list of engine road names.
        Parameters:
        model - The string model name, can be NONE.
        Returns:
        List of engine road names.
      • store

        public void store​(Element root)
        Create an XML element to represent this Entry. This member has to remain synchronized with the detailed DTD in operations-engines.dtd.
        Parameters:
        root - The common Element for operations-engines.dtd.
      • setDirtyAndFirePropertyChange

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