Package jmri
Interface ConditionalManager
-
- All Superinterfaces:
Manager<Conditional>
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeProvider
- All Known Implementing Classes:
DefaultConditionalManager
public interface ConditionalManager extends Manager<Conditional>
Interface for obtaining ConditionalsThis doesn't have a "new" method, since Conditionals 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
addWhereUsed(java.lang.String target, java.lang.String reference)
Add a conditional reference to the array indicated by the target system name.Conditional
createNewConditional(java.lang.String systemName, java.lang.String userName)
Method to create a new Conditional if the Conditional does not exist Returns null if a Conditional with the same systemName or userName already exists, or if there is trouble creating a new Conditional If the parent Logix cannot be found, the userName cannot be checked, but the Conditional is still created.void
deleteConditional(Conditional c)
Delete Conditional by removing it from the manager.void
displayWhereUsed()
Display the complete structure, used for debugging purposes.void
dispose()
Free resources when no longer used.Conditional
getBySystemName(java.lang.String s)
Locate an existing instance based on a system name.Conditional
getByUserName(java.lang.String s)
Locate an existing instance based on a user name.Conditional
getByUserName(Logix x, java.lang.String s)
Conditional
getConditional(java.lang.String name)
Conditional
getConditional(Logix x, java.lang.String name)
Method to get an existing Conditional.Logix
getParentLogix(java.lang.String name)
Parses the Conditional system name to get the parent Logix system name, then gets the parent Logix, and returns it.java.util.List<java.lang.String>
getSystemNameListForLogix(Logix x)
Get a list of all Conditional system names with the specified Logix parent.java.util.ArrayList<java.lang.String>
getTargetList(java.lang.String reference)
Get the target system names used by this conditionaljava.util.ArrayList<java.lang.String>
getWhereUsed(java.lang.String target)
Get a list of conditional references for the indicated conditionaljava.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>>
getWhereUsedMap()
Return a copy of the entire map.void
removeWhereUsed(java.lang.String target, java.lang.String reference)
Remove a conditional reference from the array indicated by the target system name.-
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.beans.SilenceablePropertyChangeProvider
setPropertyChangesSilenced
-
Methods inherited from interface jmri.beans.VetoableChangeProvider
addVetoableChangeListener, addVetoableChangeListener, getVetoableChangeListeners, getVetoableChangeListeners, removeVetoableChangeListener, removeVetoableChangeListener
-
-
-
-
Method Detail
-
dispose
void dispose()
Description copied from interface:Manager
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<Conditional>
-
createNewConditional
Conditional createNewConditional(java.lang.String systemName, java.lang.String userName)
Method to create a new Conditional if the Conditional does not exist Returns null if a Conditional with the same systemName or userName already exists, or if there is trouble creating a new Conditional 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.- Parameters:
systemName
- the system nameuserName
- the user name- Returns:
- the new conditional or null if a Conditional already exists with either name
-
getParentLogix
Logix getParentLogix(java.lang.String name)
Parses the Conditional system name to get the parent Logix system name, then gets the parent Logix, and returns it.- Parameters:
name
- system name of Conditional- Returns:
- the logix for the conditional
-
getConditional
Conditional getConditional(Logix x, java.lang.String name)
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.- Parameters:
x
- parent Logix (may be null)name
- name to look up- Returns:
- null if no match found
-
getConditional
Conditional getConditional(java.lang.String name)
-
getByUserName
Conditional getByUserName(java.lang.String s)
Description copied from interface:Manager
Locate an existing instance based on a user name.- Specified by:
getByUserName
in interfaceManager<Conditional>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getByUserName
Conditional getByUserName(Logix x, java.lang.String s)
-
getBySystemName
Conditional getBySystemName(java.lang.String s)
Description copied from interface:Manager
Locate an existing instance based on a system name.- Specified by:
getBySystemName
in interfaceManager<Conditional>
- Parameters:
s
- System Name of the required NamedBean- Returns:
- requested NamedBean object or null if none exists
-
getSystemNameListForLogix
java.util.List<java.lang.String> getSystemNameListForLogix(Logix x)
Get a list of all Conditional system names with the specified Logix parent.- Parameters:
x
- the logix- Returns:
- a list of Conditional system names
-
deleteConditional
void deleteConditional(Conditional c)
Delete Conditional by removing it from the manager. The parent Logix must first be deactivated so it stops processing.- Parameters:
c
- the conditional to remove
-
getWhereUsedMap
java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getWhereUsedMap()
Return a copy of the entire map. Used byLogixTableAction.buildWhereUsedListing()
- Returns:
- a copy of the map
- Since:
- 4.7.4
-
addWhereUsed
void addWhereUsed(java.lang.String target, java.lang.String reference)
Add a conditional reference to the array indicated by the target system name.- 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
java.util.ArrayList<java.lang.String> getWhereUsed(java.lang.String target)
Get a list of conditional references for the indicated conditional- Parameters:
target
- The target conditional for a conditional reference- Returns:
- an ArrayList or null if none
- Since:
- 4.7.4
-
removeWhereUsed
void removeWhereUsed(java.lang.String target, java.lang.String reference)
Remove a conditional reference from the array indicated by the target system name.- 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
void displayWhereUsed()
Display the complete structure, used for debugging purposes.- Since:
- 4.7.4
-
getTargetList
java.util.ArrayList<java.lang.String> getTargetList(java.lang.String reference)
Get the target system names used by this conditional- Parameters:
reference
- The system name of the conditional the refers to other conditionals.- Returns:
- a list of the target conditionals
- Since:
- 4.7.4
-
-