Package jmri.implementation
Class AbstractConsistManager
java.lang.Object
jmri.implementation.AbstractConsistManager
- All Implemented Interfaces:
ConsistManager
- Direct Known Subclasses:
DccConsistManager,EasyDccConsistManager,InternalConsistManager,LocoNetConsistManager,MqttConsistManager,NceConsistManager,NmraConsistManager,TmccConsistManager,XNetConsistManager
An Abstract Consist Manager on top of which system specific consist managers
can be built.
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.ConsistManager
ConsistManager.EnableListener -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract ConsistaddConsist(LocoAddress address) Add a new Consist with the given address.voidRegister a ConsistListListener object with this ConsistManagerdecodeErrorCode(int errorCode) Translate Error Codes relieved by a consistListener into StringsvoiddelConsist(LocoAddress address) Remove an old Consist.getConsist(LocoAddress address) Find a Consist with this consist address, and return it.Return the list of consists we know about.voidNotify the registered ConsistListListener objects that the ConsistList has changed.voidRemove a ConsistListListener object with this ConsistManagervoidRequest an update from the layout, loading Consists from the command station.protected booleanAllow a request for consist updates from the layout.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.ConsistManager
canBeDisabled, csConsistNeedsSeperateAddress, isAdvancedConsistPossible, isCommandStationConsistPossible, isEnabled, isSingleFormConsistRequired, registerEnableListener, unregisterEnableListener
-
Field Details
-
consistTable
-
-
Constructor Details
-
AbstractConsistManager
public AbstractConsistManager()
-
-
Method Details
-
getConsist
Find a Consist with this consist address, and return it.- Specified by:
getConsistin interfaceConsistManager- Parameters:
address- the consist address- Returns:
- an existing or new consist
-
addConsist
Add a new Consist with the given address.- Parameters:
address- consist address- Returns:
- a consist at address; this will be the existing consist if a consist is already known to exist at address
-
delConsist
Description copied from interface:ConsistManagerRemove an old Consist.- Specified by:
delConsistin interfaceConsistManager- Parameters:
address- the consist address
-
getConsistList
Return the list of consists we know about.- Specified by:
getConsistListin interfaceConsistManager- Returns:
- list of addresses
-
decodeErrorCode
Description copied from interface:ConsistManagerTranslate Error Codes relieved by a consistListener into Strings- Specified by:
decodeErrorCodein interfaceConsistManager- Parameters:
errorCode- the code- Returns:
- the description
-
requestUpdateFromLayout
Description copied from interface:ConsistManagerRequest an update from the layout, loading Consists from the command station.- Specified by:
requestUpdateFromLayoutin interfaceConsistManager
-
shouldRequestUpdateFromLayout
Allow a request for consist updates from the layout. If not overridden by a concrete subclass, this method always returns true.- Returns:
- true if the request can be made, false if not
-
addConsistListListener
Description copied from interface:ConsistManagerRegister a ConsistListListener object with this ConsistManager- Specified by:
addConsistListListenerin interfaceConsistManager- Parameters:
l- a Consist List Listener object.
-
removeConsistListListener
Description copied from interface:ConsistManagerRemove a ConsistListListener object with this ConsistManager- Specified by:
removeConsistListListenerin interfaceConsistManager- Parameters:
l- a Consist List Listener object.
-
notifyConsistListChanged
Description copied from interface:ConsistManagerNotify the registered ConsistListListener objects that the ConsistList has changed.- Specified by:
notifyConsistListChangedin interfaceConsistManager
-