Interface TransitManager
-
- All Superinterfaces:
Manager<Transit>
,PropertyChangeProvider
,SilenceablePropertyChangeProvider
,VetoableChangeProvider
- All Known Implementing Classes:
DefaultTransitManager
public interface TransitManager extends Manager<Transit>
Implementation of a Transit ManagerThis doesn't need an interface, since Transits are globaly implemented, instead of being system-specific.
Note that Transit system names must begin with system prefix and type character, usually IZ, and be followed by a string, usually, but not always, a number. This is enforced when a Transit is created.
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 Transit
createNewTransit(java.lang.String userName)
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.Transit
createNewTransit(java.lang.String systemName, java.lang.String userName)
Create a new Transit if the Transit does not exist.void
deleteTransit(Transit z)
Remove an existing Transit.java.util.ArrayList<Transit>
getListEntryBlock(Block b)
java.util.ArrayList<Transit>
getListUsingBlock(Block b)
java.util.ArrayList<Transit>
getListUsingSection(Section s)
Get a list of Transits which use a specified Section.Transit
getTransit(java.lang.String name)
Get an existing Transit.-
Methods inherited from interface jmri.Manager
addDataListener, deleteBean, deregister, dispose, getBeanTypeHandled, getBeanTypeHandled, getBySystemName, getByUserName, 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
-
createNewTransit
@Nonnull Transit createNewTransit(@CheckForNull java.lang.String systemName, java.lang.String userName) throws NamedBean.BadNameException
Create a new Transit if the Transit does not exist. This is NOT a provide method.- Parameters:
systemName
- the desired system nameuserName
- the desired user name- Returns:
- a new Transit
- Throws:
NamedBean.BadNameException
- if a Transit with the same systemName or userName already exists, or if there is trouble creating a new Transit.
-
createNewTransit
@Nonnull Transit createNewTransit(java.lang.String userName) throws NamedBean.BadNameException
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username.Note: Since system names should be kept short for use in Dispatcher, automatically generated system names are in the form
IZnn
, wherenn
is the first available number.- Parameters:
userName
- the desired user name- Returns:
- a new Transit
- Throws:
NamedBean.BadNameException
- if userName is already associated with another Transit
-
getTransit
@CheckForNull Transit getTransit(java.lang.String name)
Get an existing Transit. First looks up assuming that name is a User Name. If this fails looks up assuming that name is a System Name. If both fail, returns null.- Parameters:
name
- User name or system name to match- Returns:
- null if no match found
-
deleteTransit
void deleteTransit(Transit z)
Remove an existing Transit.- Parameters:
z
- the transit to remove
-
getListUsingSection
@Nonnull java.util.ArrayList<Transit> getListUsingSection(Section s)
Get a list of Transits which use a specified Section.- Parameters:
s
- the section to check Transits against- Returns:
- a list, possibly empty, of Transits using section s.
-
getListUsingBlock
@Nonnull java.util.ArrayList<Transit> getListUsingBlock(Block b)
-
getListEntryBlock
@Nonnull java.util.ArrayList<Transit> getListEntryBlock(Block b)
-
-