Package jmri
Interface SignalMastManager
-
- All Superinterfaces:
Manager<SignalMast>
,PropertyChangeProvider
,ProvidingManager<SignalMast>
,SilenceablePropertyChangeProvider
,VetoableChangeProvider
- All Known Implementing Classes:
DefaultSignalMastManager
public interface SignalMastManager extends ProvidingManager<SignalMast>
Interface for obtaining signal masts.This doesn't have a "new" method, as SignalMasts are separately implemented, instead of being system-specific.
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/interfaces inherited from interface jmri.Manager
Manager.ManagerDataEvent<E extends NamedBean>, Manager.ManagerDataListener<E extends NamedBean>, Manager.NameValidity
-
-
Field Summary
-
Fields inherited from interface jmri.Manager
ANALOGIOS, AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, CTCDATA, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXNG_ANALOG_ACTIONS, LOGIXNG_ANALOG_EXPRESSIONS, LOGIXNG_CONDITIONALNGS, LOGIXNG_DIGITAL_ACTIONS, LOGIXNG_DIGITAL_BOOLEAN_ACTIONS, LOGIXNG_DIGITAL_EXPRESSIONS, LOGIXNG_GLOBAL_VARIABLES, LOGIXNG_MODULES, LOGIXNG_STRING_ACTIONS, LOGIXNG_STRING_EXPRESSIONS, LOGIXNG_TABLES, LOGIXNGS, LOGIXS, MEMORIES, METERFRAMES, METERS, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
dispose()
Free resources when no longer used.SignalMast
getBySystemName(java.lang.String s)
Locate an existing instance based on a system name.SignalMast
getByUserName(java.lang.String s)
Locate an existing instance based on a user name.SignalMast
getSignalMast(java.lang.String name)
Get an existing SignalMast or return null if it doesn't exist.SignalMast
provideCustomSignalMast(java.lang.String systemName, java.lang.Class<? extends SignalMast> mastClass)
Retrieve or create a new signal mast with a given system name.SignalMast
provideSignalMast(java.lang.String name)
Get the SignalMast with the user name, then system name if needed; if that fails, create a new SignalMast.SignalMast
provideSignalMast(java.lang.String prefix, java.lang.String signalSystem, java.lang.String mastName, java.lang.String[] heads)
-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, getBeanTypeHandled, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getNamedBeanClass, getNamedBeanSet, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, getXMLOrder, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, typeLetter, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormat
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Methods inherited from interface jmri.ProvidingManager
provide
-
Methods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Method Detail
-
dispose
void dispose()
Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.- Specified by:
dispose
in interfaceManager<SignalMast>
-
getSignalMast
@CheckForNull SignalMast getSignalMast(@Nonnull java.lang.String name)
Get an existing SignalMast or return null if it doesn't exist. Locates via user name, then system name if needed.- Parameters:
name
- User name or system name to match- Returns:
- null if no match found
-
provideSignalMast
@Nonnull SignalMast provideSignalMast(@Nonnull java.lang.String name) throws java.lang.IllegalArgumentException
Get the SignalMast with the user name, then system name if needed; if that fails, create a new SignalMast. If the name is a valid system name, it will be used for the new SignalMast.- Parameters:
name
- User name, system name, or address which can be promoted to system name- Returns:
- never null
- Throws:
java.lang.IllegalArgumentException
- if SignalMast doesn't already exist and the manager cannot create the SignalMast due to an illegal name or name that can't be parsed
-
provideCustomSignalMast
@Nonnull SignalMast provideCustomSignalMast(@Nonnull java.lang.String systemName, java.lang.Class<? extends SignalMast> mastClass) throws JmriException
Retrieve or create a new signal mast with a given system name. If a new object is created, it is also registered in this manager.- Parameters:
systemName
- the system name by which to look up the mast, or to create anew.mastClass
- specific signal mast class. Must have a single-argument string constructor to crete it by system name.- Returns:
- a registered signal mast (might be newly created),
- Throws:
JmriException
- if a signal mast with the given system name is already registered but it is not of the correct class, or an internal error happens during construction.
-
provideSignalMast
@Nonnull SignalMast provideSignalMast(@Nonnull java.lang.String prefix, @Nonnull java.lang.String signalSystem, @Nonnull java.lang.String mastName, @Nonnull java.lang.String[] heads) throws JmriException
- Throws:
JmriException
-
getByUserName
@CheckForNull SignalMast getByUserName(@Nonnull java.lang.String s)
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<SignalMast>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getBySystemName
@CheckForNull SignalMast getBySystemName(@Nonnull java.lang.String s)
Locate an existing instance based on a system name.- Specified by:
getBySystemName
in interfaceManager<SignalMast>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
-