Class RollingStockManager<T extends RollingStock>
java.lang.Object
jmri.beans.PropertyChangeSupport
jmri.jmrit.operations.rollingstock.RollingStockManager<T>
- Type Parameters:
T- the type of RollingStock managed by this manager
- All Implemented Interfaces:
PropertyChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider
- Direct Known Subclasses:
CarManager,EngineManager
public abstract class RollingStockManager<T extends RollingStock>
extends PropertyChangeSupport
implements PropertyChangeListener
Base class for rolling stock managers car and engine.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intprotected static final intstatic final Stringstatic final StringFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupport -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringconvertBuildDate(String date) voidRemove all RollingStock from rostervoidderegister(T rs) Unload RollingStock.voiddispose()Sort by when rolling stock was builtSort by rolling stock color namesSort by rolling stock destinationGet rolling stock by idSort by rolling stock idGet a list of all rolling stock sorted last date usedgetByLastDateList(List<T> inList) Sort a specific list of rolling stock last date usedSort by rolling stock locationSort by rolling stock movesSort by rolling stock number, number can be alphanumeric.Sort by rolling stock ownerGet a rolling stock by Radio Frequency Identification (RFID)Sort by rolling stock RFIDgetByRoadAndNumber(String road, String number) Get rolling stock by road and numberSort by rolling stock road nameSort by rolling stocks in trainsgetByTrainList(Train train) Get a list of rolling stocks assigned to a train ordered by locationgetByTypeAndRoad(String type, String road) Get a rolling stock by type and road.Sort by rolling stock type namesgetByTypeList(String type) Return rolling stock of a specific typeSort by rolling stock valueprotected Comparator<T>getComparator(int attribute) getList()Returns a list (no order) of RollingStock.Returns a list (no order) of RollingStock at a location.Returns a list (no order) of RollingStock on a track.Returns a list (no order) of RollingStock in a train.intGet the number of items in the rosterabstract RollingStockvoidvoidLoad RollingStock.voidvoidresetMoves(List<T> list) sortByTrackPriority(List<T> list) Methods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
NONE
- See Also:
-
_hashTable
-
LISTLENGTH_CHANGED_PROPERTY
- See Also:
-
BY_NUMBER
- See Also:
-
BY_ROAD
- See Also:
-
BY_TYPE
- See Also:
-
BY_COLOR
- See Also:
-
BY_LOCATION
- See Also:
-
BY_DESTINATION
- See Also:
-
BY_TRAIN
- See Also:
-
BY_MOVES
- See Also:
-
BY_BUILT
- See Also:
-
BY_OWNER
- See Also:
-
BY_RFID
- See Also:
-
BY_VALUE
- See Also:
-
BY_LAST
- See Also:
-
BY_BLOCKING
- See Also:
-
BY_COMMENT
- See Also:
-
-
Constructor Details
-
RollingStockManager
public RollingStockManager()
-
-
Method Details
-
newRS
-
getNumEntries
Get the number of items in the roster- Returns:
- Number of rolling stock in the Roster
-
dispose
-
getById
Get rolling stock by id- Parameters:
id- The string id.- Returns:
- requested RollingStock object or null if none exists
-
getByRoadAndNumber
Get rolling stock by road and number- Parameters:
road- RollingStock roadnumber- RollingStock number- Returns:
- requested RollingStock object or null if none exists
-
getByTypeAndRoad
Get a rolling stock by type and road. Used to test that rolling stock with a specific type and road exists.- Parameters:
type- RollingStock type.road- RollingStock road.- Returns:
- the first RollingStock found with the specified type and road.
-
getByRfid
Get a rolling stock by Radio Frequency Identification (RFID)- Parameters:
rfid- RollingStock's RFID.- Returns:
- the RollingStock with the specific RFID, or null if not found
-
register
Load RollingStock.- Parameters:
rs- The RollingStock to load.
-
deregister
Unload RollingStock.- Parameters:
rs- The RollingStock to delete.
-
deleteAll
Remove all RollingStock from roster -
resetMoves
-
resetMoves
-
getList
Returns a list (no order) of RollingStock.- Returns:
- list of RollingStock
-
getByIdList
Sort by rolling stock id- Returns:
- list of RollingStock ordered by id
-
getByRoadNameList
Sort by rolling stock road name- Returns:
- list of RollingStock ordered by road name
-
getByNumberList
Sort by rolling stock number, number can be alphanumeric. RollingStock number can also be in the format of nnnn-N, where the "-N" allows the user to enter RollingStock with similar numbers.- Returns:
- list of RollingStock ordered by number
-
getByTypeList
Sort by rolling stock type names- Returns:
- list of RollingStock ordered by RollingStock type
-
getByTypeList
Return rolling stock of a specific type- Parameters:
type- type of rolling stock- Returns:
- list of RollingStock that are specific type
-
getByColorList
Sort by rolling stock color names- Returns:
- list of RollingStock ordered by RollingStock color
-
getByLocationList
Sort by rolling stock location- Returns:
- list of RollingStock ordered by RollingStock location
-
getByDestinationList
Sort by rolling stock destination- Returns:
- list of RollingStock ordered by RollingStock destination
-
getByTrainList
Sort by rolling stocks in trains- Returns:
- list of RollingStock ordered by trains
-
getByMovesList
Sort by rolling stock moves- Returns:
- list of RollingStock ordered by RollingStock moves
-
getByBuiltList
Sort by when rolling stock was built- Returns:
- list of RollingStock ordered by RollingStock built date
-
getByOwnerList
Sort by rolling stock owner- Returns:
- list of RollingStock ordered by RollingStock owner
-
getByValueList
Sort by rolling stock value- Returns:
- list of RollingStock ordered by value
-
getByRfidList
Sort by rolling stock RFID- Returns:
- list of RollingStock ordered by RFIDs
-
getByLastDateList
Get a list of all rolling stock sorted last date used- Returns:
- list of RollingStock ordered by last date
-
getByCommentList
-
getByLastDateList
Sort a specific list of rolling stock last date used- Parameters:
inList- list of rolling stock to sort.- Returns:
- list of RollingStock ordered by last date
-
getByList
-
getComparator
-
sortByTrackPriority
-
convertBuildDate
-
getByTrainList
Get a list of rolling stocks assigned to a train ordered by location- Parameters:
train- The Train.- Returns:
- List of RollingStock assigned to the train ordered by location
-
getList
Returns a list (no order) of RollingStock in a train.- Parameters:
train- The Train.- Returns:
- list of RollingStock
-
getList
Returns a list (no order) of RollingStock at a location.- Parameters:
location- location to search for.- Returns:
- list of RollingStock
-
getList
Returns a list (no order) of RollingStock on a track.- Parameters:
track- Track to search for.- Returns:
- list of RollingStock
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-