Package jmri.managers
Class AbstractCabSignalManager
java.lang.Object
jmri.managers.AbstractCabSignalManager
- All Implemented Interfaces:
CabSignalManager,Disposable
- Direct Known Subclasses:
CbusCabSignalManager,DefaultCabSignalManager,LnCabSignalManager
public abstract class AbstractCabSignalManager
extends Object
implements CabSignalManager, Disposable
Abstract implementation of the
This file is part of JMRI.
CabSignalManager interface.
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidRegister a CabSignalListListener object with this CabSignalManagerprotected abstract CabSignalcreateCabSignal(LocoAddress address) Create a new cab signal with the given address.voiddelCabSignal(LocoAddress address) Remove an old CabSignal.voiddispose()Called when disposing of a disposable.getCabSignal(LocoAddress address) Find a CabSignal with the given address, and return it.Get an array of known cab signals.Get a list of known cab signal addresses.voidNotify the registered CabSignalListListener objects that the CabSignalList has changed.voidRemove a CabSignalListListener object with this CabSignalManager
-
Constructor Details
-
AbstractCabSignalManager
public AbstractCabSignalManager()
-
-
Method Details
-
getCabSignal
Find a CabSignal with the given address, and return it. If the CabSignal doesn't exit, create it.- Specified by:
getCabSignalin interfaceCabSignalManager- Parameters:
address- the cab signal for the address- Returns:
- an existing or new cab signal
-
createCabSignal
Create a new cab signal with the given address.- Parameters:
address- the address the cab signal is for- Returns:
- a new cab signal
-
delCabSignal
Remove an old CabSignal.- Specified by:
delCabSignalin interfaceCabSignalManager- Parameters:
address- the address associated with the cab signal
-
getCabSignalList
Get a list of known cab signal addresses.- Specified by:
getCabSignalListin interfaceCabSignalManager- Returns:
- list of cab signal addresses
-
getCabSignalArray
Get an array of known cab signals.- Specified by:
getCabSignalArrayin interfaceCabSignalManager- Returns:
- array of cab signals
-
addCabSignalListListener
Register a CabSignalListListener object with this CabSignalManager- Specified by:
addCabSignalListListenerin interfaceCabSignalManager- Parameters:
listener- a CabSignal List Listener object.
-
removeCabSignalListListener
Remove a CabSignalListListener object with this CabSignalManager- Specified by:
removeCabSignalListListenerin interfaceCabSignalManager- Parameters:
listener- a CabSignal List Listener object.
-
notifyCabSignalListChanged
Notify the registered CabSignalListListener objects that the CabSignalList has changed.- Specified by:
notifyCabSignalListChangedin interfaceCabSignalManager
-
dispose
Description copied from interface:DisposableCalled when disposing of a disposable.Note there are no assurances this method will not be called multiple times against a single instance of this Disposable. It is the responsibility of this Disposable to protect itself and the application from ensuring that calling this method multiple times has no unwanted side effects.
- Specified by:
disposein interfaceDisposable
-