Package jmri
Interface ConsistManager
-
- All Known Implementing Classes:
AbstractConsistManager
,CbusConsistManager
,DccConsistManager
,EasyDccConsistManager
,InternalConsistManager
,JsonConsistManager
,LocoNetConsistManager
,MqttConsistManager
,NceConsistManager
,NmraConsistManager
,WiFiConsistManager
,XNetConsistManager
public interface ConsistManager
Interface for Consist Manager objects, which provide access to the existing Consists and allows for creation and destruction.
This file is part of JMRI.JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ConsistManager.EnableListener
A listener that listens to whether the manager is enabled or disabled.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
addConsistListListener(ConsistListListener listener)
Register a ConsistListListener object with this ConsistManagerdefault boolean
canBeDisabled()
Can this consist manager be disabled?boolean
csConsistNeedsSeperateAddress()
Does a command station consist require a separate consist address from locomotives in consist?java.lang.String
decodeErrorCode(int errorCode)
Translate Error Codes relieved by a consistListener into Stringsvoid
delConsist(LocoAddress address)
Remove an old Consist.Consist
getConsist(LocoAddress address)
Find a Consist with this consist address, and return it.java.util.ArrayList<LocoAddress>
getConsistList()
Get a list of known consist addresses.boolean
isCommandStationConsistPossible()
Does this implementation support Command Station Consists?default boolean
isEnabled()
Check if this manager is enabledvoid
notifyConsistListChanged()
Notify the registered ConsistListListener objects that the ConsistList has changed.default void
registerEnableListener(ConsistManager.EnableListener listener)
Register a listener that is called if this manager is enabled or disabled.void
removeConsistListListener(ConsistListListener listener)
Remove a ConsistListListener object with this ConsistManagervoid
requestUpdateFromLayout()
Request an update from the layout, loading Consists from the command station.default void
unregisterEnableListener(ConsistManager.EnableListener listener)
Unregister a listener that is called if this manager is enabled or disabled.
-
-
-
Method Detail
-
getConsist
Consist getConsist(LocoAddress address)
Find a Consist with this consist address, and return it. If the Consist doesn't exit, create it.- Parameters:
address
- the consist address- Returns:
- an existing or new consist
-
delConsist
void delConsist(LocoAddress address)
Remove an old Consist.- Parameters:
address
- the consist address
-
isCommandStationConsistPossible
boolean isCommandStationConsistPossible()
Does this implementation support Command Station Consists?- Returns:
- true if command station consists are supported; false otherwise
-
csConsistNeedsSeperateAddress
boolean csConsistNeedsSeperateAddress()
Does a command station consist require a separate consist address from locomotives in consist?- Returns:
- true is command station consist requires separate address; false otherwise
-
getConsistList
java.util.ArrayList<LocoAddress> getConsistList()
Get a list of known consist addresses.- Returns:
- list of addresses
-
decodeErrorCode
java.lang.String decodeErrorCode(int errorCode)
Translate Error Codes relieved by a consistListener into Strings- Parameters:
errorCode
- the code- Returns:
- the description
-
requestUpdateFromLayout
void requestUpdateFromLayout()
Request an update from the layout, loading Consists from the command station.
-
addConsistListListener
void addConsistListListener(ConsistListListener listener)
Register a ConsistListListener object with this ConsistManager- Parameters:
listener
- a Consist List Listener object.
-
removeConsistListListener
void removeConsistListListener(ConsistListListener listener)
Remove a ConsistListListener object with this ConsistManager- Parameters:
listener
- a Consist List Listener object.
-
notifyConsistListChanged
void notifyConsistListChanged()
Notify the registered ConsistListListener objects that the ConsistList has changed.
-
canBeDisabled
default boolean canBeDisabled()
Can this consist manager be disabled?- Returns:
- true if the manager can be disabled, false otherwise
-
registerEnableListener
default void registerEnableListener(ConsistManager.EnableListener listener)
Register a listener that is called if this manager is enabled or disabled.- Parameters:
listener
- the listener
-
unregisterEnableListener
default void unregisterEnableListener(ConsistManager.EnableListener listener)
Unregister a listener that is called if this manager is enabled or disabled.- Parameters:
listener
- the listener
-
isEnabled
default boolean isEnabled()
Check if this manager is enabled- Returns:
- true if enabled
-
-