Package jmri.jmrix.can.cbus
Class CbusConsistManager
- java.lang.Object
-
- jmri.implementation.AbstractConsistManager
-
- jmri.implementation.NmraConsistManager
-
- jmri.jmrix.can.cbus.CbusConsistManager
-
- All Implemented Interfaces:
ConsistManager
,ConsistManager.EnableListener
public class CbusConsistManager extends NmraConsistManager implements ConsistManager.EnableListener
The CBUS Consist Manager which uses the NmraConsist class for the consists it builds. This implementation just tracks the consist via a table ofDccConsist
objects that handle the actual operations.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.ConsistManager
ConsistManager.EnableListener
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
_enabled
protected static java.util.Vector<ConsistManager.EnableListener>
enableListeners
-
Fields inherited from class jmri.implementation.AbstractConsistManager
consistTable
-
-
Constructor Summary
Constructors Constructor Description CbusConsistManager(CommandStation cs)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canBeDisabled()
Can this consist manager be disabled?boolean
isEnabled()
Check if this manager is enabledvoid
registerEnableListener(ConsistManager.EnableListener listener)
Register a listener that is called if this manager is enabled or disabled.void
setEnabled(boolean value)
A listener that listens to whether the manager is enabled or disabled.void
unregisterEnableListener(ConsistManager.EnableListener listener)
Unregister a listener that is called if this manager is enabled or disabled.-
Methods inherited from class jmri.implementation.NmraConsistManager
addConsist, csConsistNeedsSeperateAddress, isCommandStationConsistPossible
-
Methods inherited from class jmri.implementation.AbstractConsistManager
addConsistListListener, decodeErrorCode, delConsist, getConsist, getConsistList, notifyConsistListChanged, removeConsistListListener, requestUpdateFromLayout, shouldRequestUpdateFromLayout
-
-
-
-
Field Detail
-
enableListeners
protected static final java.util.Vector<ConsistManager.EnableListener> enableListeners
-
_enabled
protected boolean _enabled
-
-
Constructor Detail
-
CbusConsistManager
public CbusConsistManager(CommandStation cs)
-
-
Method Detail
-
canBeDisabled
public boolean canBeDisabled()
Can this consist manager be disabled?- Specified by:
canBeDisabled
in interfaceConsistManager
- Returns:
- true if the manager can be disabled, false otherwise
-
registerEnableListener
public void registerEnableListener(ConsistManager.EnableListener listener)
Register a listener that is called if this manager is enabled or disabled.- Specified by:
registerEnableListener
in interfaceConsistManager
- Parameters:
listener
- the listener
-
unregisterEnableListener
public void unregisterEnableListener(ConsistManager.EnableListener listener)
Unregister a listener that is called if this manager is enabled or disabled.- Specified by:
unregisterEnableListener
in interfaceConsistManager
- Parameters:
listener
- the listener
-
isEnabled
public boolean isEnabled()
Check if this manager is enabled- Specified by:
isEnabled
in interfaceConsistManager
- Returns:
- true if enabled
-
setEnabled
public void setEnabled(boolean value)
A listener that listens to whether the manager is enabled or disabled. Call each listeners setEnabled() method.- Specified by:
setEnabled
in interfaceConsistManager.EnableListener
- Parameters:
value
- true to enable
-
-