Class DefaultConditionalManager
- All Implemented Interfaces:
PropertyChangeListener,VetoableChangeListener,EventListener,PropertyChangeFirer,PropertyChangeProvider,SilenceablePropertyChangeProvider,VetoableChangeFirer,VetoableChangeProvider,ConditionalManager,Manager<Conditional>
Note that Conditionals always have an associated parent Logix.
Logix system names must begin with IX, and be followed by a string, usually, but not always, a number. The system names of Conditionals always begin with the parent Logix's system name, then there is a capital C and a number.
Conditional system names are set automatically when the Conditional is
created. All alphabetic characters in a Conditional system name must be upper
case. This is enforced when a new Conditional is created via
LogixTableAction
Conditional user names have specific requirements that are
addressed in the Conditional class.
-
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 class jmri.managers.AbstractManager
_beans, _tsys, _tuser, lastAutoNamedBeanRef, memo, paddedNumber, silenceableProperties, silencedPropertiesFields inherited from class jmri.beans.VetoableChangeSupport
vetoableChangeSupportFields inherited from class jmri.beans.PropertyChangeSupport
propertyChangeSupportFields 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, PROPERTY_BEANS, PROPERTY_CAN_DELETE, PROPERTY_DISPLAY_LIST_NAME, PROPERTY_DO_DELETE, PROPERTY_DO_NOT_DELETE, PROPERTY_LENGTH, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, STRINGIOS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddWhereUsed(String target, String reference) Add a conditional reference to the array indicated by the target system name.createNewConditional(String systemName, String userName) Method to create a new Conditional if the Conditional does not exist If the parent Logix cannot be found, the userName cannot be checked, but the Conditional is still created.voidRemove an existing Conditional.voidDisplay the complete structure, used for debugging purposes.getBeanTypeHandled(boolean plural) Get the user-readable name of the type of NamedBean handled by this manager.getBySystemName(String name) Locate an existing instance based on a system name.getByUserName(String key) Locate an existing instance based on a user name.getByUserName(Logix x, String key) getConditional(String name) getConditional(Logix x, String name) Method to get an existing Conditional.Get the class of NamedBean supported by this Manager.Create a named bean set for conditionals.getParentLogix(String name) Parses the Conditional system name to get the parent Logix system name, then gets the parent Logix, and returns it.Get a list of all Conditional system names with the specified Logix parentgetTargetList(String reference) Get the target system names used by this conditionalgetWhereUsed(String target) Get a list of conditional references for the indicated conditionalReturn a copy of the entire map.intDetermine the order that types should be written when storing panel files.protected voidDo not insist that Conditional user names are unique, unlike the usual NamedBean supportvoidremoveWhereUsed(String target, String reference) Remove a conditional reference from the array indicated by the target system name.charMethods inherited from class jmri.managers.AbstractManager
addDataListener, checkNumeric, createSystemName, deleteBean, deregister, dispose, fireDataListenersAdded, fireDataListenersRemoved, fireVetoableChange, getAutoSystemName, getBySystemName, getKnownBeanProperties, getMemo, getNamedBean, getObjectCount, getOuterBean, getSystemPrefix, makeSystemName, propertyChange, register, registerSelf, registerUserName, removeDataListener, setDataListenerMute, setPropertyChangesSilenced, setRegisterSelf, updateAutoNumber, validSystemNameFormat, vetoableChangeMethods inherited from class jmri.beans.VetoableChangeSupport
addVetoableChangeListener, addVetoableChangeListener, fireVetoableChange, fireVetoableChange, fireVetoableChange, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListenerMethods inherited from class jmri.beans.PropertyChangeSupport
addPropertyChangeListener, addPropertyChangeListener, fireIndexedPropertyChange, fireIndexedPropertyChange, fireIndexedPropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface jmri.ConditionalManager
disposeMethods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, getBeanTypeHandled, getEntryToolTip, getKnownBeanProperties, getMemo, getNamedBean, getObjectCount, getSubSystemNamePrefix, getSystemNamePrefix, getSystemPrefix, isValidSystemNameFormat, makeSystemName, makeSystemName, makeSystemName, register, removeDataListener, setDataListenerMute, validateBadCharsInSystemNameFormat, validateIntegerSystemNameFormat, validateNmraAccessorySystemNameFormat, validateSystemNameFormat, validateSystemNameFormat, validateSystemNameFormatOnlyNumeric, validateSystemNamePrefix, validateTrimmedMin1NumberSystemNameFormat, validateTrimmedSystemNameFormat, validateUppercaseTrimmedSystemNameFormat, validSystemNameFormatMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListenerMethods inherited from interface jmri.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilencedMethods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
Constructor Details
-
DefaultConditionalManager
-
-
Method Details
-
getXMLOrder
Description copied from interface:ManagerDetermine the order that types should be written when storing panel files. Uses one of the constants defined in this class.Yes, that's an overly-centralized methodology, but it works for now.
- Specified by:
getXMLOrderin interfaceManager<Conditional>- Returns:
- write order for this Manager; larger is later.
-
typeLetter
- Specified by:
typeLetterin interfaceManager<Conditional>- Returns:
- The type letter for a specific implementation
-
createNewConditional
Method to create a new Conditional if the Conditional does not exist If the parent Logix cannot be found, the userName cannot be checked, but the Conditional is still created. The scenario can happen when a Logix is loaded from a file after its Conditionals.- Specified by:
createNewConditionalin interfaceConditionalManager- Parameters:
systemName- properly formatted system name for the new ConditionaluserName- must not be null, use "" instead- Returns:
- null if a Conditional with the same systemName or userName already exists, or if there is trouble creating a new Conditional
-
handleUserNameUniqueness
Do not insist that Conditional user names are unique, unlike the usual NamedBean support- Overrides:
handleUserNameUniquenessin classAbstractManager<Conditional>- Parameters:
s- the bean to register
-
getParentLogix
Parses the Conditional system name to get the parent Logix system name, then gets the parent Logix, and returns it. For sensor groups, the parent Logix name is 'SYS'. LRoutes and exported Routes (RTX prefix) require special logic- Specified by:
getParentLogixin interfaceConditionalManager- Parameters:
name- system name of Conditionals- Returns:
- the parent Logix or null
-
deleteConditional
Remove an existing Conditional. Parent Logix must have been deactivated before invoking this.- Specified by:
deleteConditionalin interfaceConditionalManager- Parameters:
c- the conditional to remove
-
getConditional
Method to get an existing Conditional. First looks up assuming that name is a User Name. Note: the parent Logix must be passed in x for user name lookup. If this fails, or if x == null, looks up assuming that name is a System Name. If both fail, returns null.- Specified by:
getConditionalin interfaceConditionalManager- Parameters:
x- parent Logix (may be null)name- name to look up- Returns:
- null if no match found
-
getConditional
- Specified by:
getConditionalin interfaceConditionalManager
-
getByUserName
Description copied from class:AbstractManagerLocate an existing instance based on a user name.- Specified by:
getByUserNamein interfaceConditionalManager- Specified by:
getByUserNamein interfaceManager<Conditional>- Overrides:
getByUserNamein classAbstractManager<Conditional>- Parameters:
key- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
- Specified by:
getByUserNamein interfaceConditionalManager
-
getBySystemName
Description copied from class:AbstractManagerLocate an existing instance based on a system name.- Specified by:
getBySystemNamein interfaceConditionalManager- Specified by:
getBySystemNamein interfaceManager<Conditional>- Overrides:
getBySystemNamein classAbstractManager<Conditional>- Parameters:
name- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getSystemNameListForLogix
Get a list of all Conditional system names with the specified Logix parent- Specified by:
getSystemNameListForLogixin interfaceConditionalManager- Parameters:
x- the logix- Returns:
- a list of Conditional system names
-
getNamedBeanSet
Create a named bean set for conditionals. This requires special logic since conditional beans are not registered.- Specified by:
getNamedBeanSetin interfaceManager<Conditional>- Overrides:
getNamedBeanSetin classAbstractManager<Conditional>- Returns:
- a sorted named bean set of conditionals.
- Since:
- 4.17.5
-
getBeanTypeHandled
Description copied from interface:ManagerGet the user-readable name of the type of NamedBean handled by this manager.For instance, in the code where we are dealing with just a bean and a message that needs to be passed to the user or in a log.
- Specified by:
getBeanTypeHandledin interfaceManager<Conditional>- Parameters:
plural- true to return plural form of the type; false to return singular form- Returns:
- a string of the bean type that the manager handles, eg Turnout, Sensor etc
-
getNamedBeanClass
Get the class of NamedBean supported by this Manager. This should be the generic class used in the Manager's class declaration.- Specified by:
getNamedBeanClassin interfaceManager<Conditional>- Returns:
- the class supported by this Manager.
-
getWhereUsedMap
Return a copy of the entire map. Used byLogixTableAction.buildWhereUsedListing()- Specified by:
getWhereUsedMapin interfaceConditionalManager- Returns:
- a copy of the map
- Since:
- 4.7.4
-
addWhereUsed
Add a conditional reference to the array indicated by the target system name.- Specified by:
addWhereUsedin interfaceConditionalManager- Parameters:
target- The system name for the target conditionalreference- The system name of the conditional that contains the conditional reference- Since:
- 4.7.4
-
getWhereUsed
Get a list of conditional references for the indicated conditional- Specified by:
getWhereUsedin interfaceConditionalManager- Parameters:
target- The target conditional for a conditional reference- Returns:
- an ArrayList or null if none
- Since:
- 4.7.4
-
removeWhereUsed
Remove a conditional reference from the array indicated by the target system name.- Specified by:
removeWhereUsedin interfaceConditionalManager- Parameters:
target- The system name for the target conditionalreference- The system name of the conditional that contains the conditional reference- Since:
- 4.7.4
-
displayWhereUsed
Display the complete structure, used for debugging purposes.- Specified by:
displayWhereUsedin interfaceConditionalManager- Since:
- 4.7.4
-
getTargetList
Get the target system names used by this conditional- Specified by:
getTargetListin interfaceConditionalManager- Parameters:
reference- The system name of the conditional the refers to other conditionals.- Returns:
- a list of the target conditionals
- Since:
- 4.7.4
-