Package jmri

Interface NamedBean

All Superinterfaces:
Comparable<NamedBean>, PropertyChangeProvider
All Known Subinterfaces:
AddressedIdTag, AnalogIO, Audio, AudioBuffer, AudioListener, AudioSource, CatalogTree, CollectingReporter, Conditional, CurrentMeter, DigitalIO, IdTag, Light, Logix, Memory, Meter, RailCom, Reporter, Route, Sensor, Signal, SignalGroup, SignalHead, SignalMast, SignalMastLogic, SignalSystem, StringIO, Timebase, Turnout, VariableLight, VoltageMeter
All Known Implementing Classes:
AbstractAnalogIO, AbstractAudio, AbstractAudioBuffer, AbstractAudioListener, AbstractAudioSource, AbstractCatalogTree, AbstractIdTag, AbstractIdTagReporter, AbstractLight, AbstractMemory, AbstractNamedBean, AbstractNamedBeanDecorator, AbstractRailComReporter, AbstractReporter, AbstractSensor, AbstractSignalHead, AbstractSignalMast, AbstractStringIO, AbstractTurnout, AbstractVariableLight, AcelaLight, AcelaSensor, AcelaSignalHead, AcelaTurnout, AnymaDMX_UsbLight, Block, CatalogTreeFS, CatalogTreeIndex, CbusLight, CbusReporter, CbusSensor, CbusTurnout, Dcc4PcReporter, Dcc4PcSensor, DCCppLight, DCCppSensor, DCCppTurnout, DccSignalHead, DccSignalMast, DefaultConditional, DefaultIdTag, DefaultLogix, DefaultMemory, DefaultMeter, DefaultMeter.DefaultCurrentMeter, DefaultMeter.DefaultVoltageMeter, DefaultRailCom, DefaultRoute, DefaultSignalAppearanceMap, DefaultSignalGroup, DefaultSignalHead, DefaultSignalMastLogic, DefaultSignalSystem, DestinationPoints, DoubleTurnoutSignalHead, EasyDccTurnout, EcosReporter, EcosSensor, EcosTurnout, EliteXNetTurnout, IpocsLight, IpocsSensor, IpocsTurnout, JavaSoundAudioBuffer, JavaSoundAudioListener, JavaSoundAudioSource, JMRIClientLight, JMRIClientReporter, JMRIClientSensor, JMRIClientTurnout, JoalAudioBuffer, JoalAudioListener, JoalAudioSource, LayoutBlock, LNCPSignalMast, LnLight, LnReporter, LnSensor, LnTurnout, LsDecSignalHead, MarklinSensor, MarklinTurnout, MatrixSignalMast, MergSD2SignalHead, MqttLight, MqttSensor, MqttTurnout, MrcTurnout, Mx1Turnout, NceLight, NceSensor, NceTurnout, NullAudioBuffer, NullAudioListener, NullAudioSource, OBlock, OlcbLight, OlcbSensor, OlcbSignalMast, OlcbTurnout, QuadOutputSignalHead, RaspberryPiSensor, RaspberryPiTurnout, RfidReporter, RfidSensor, RpsReporter, RpsSensor, SCWarrant, SE8cSignalHead, SE8cSignalHead, Section, SensorGroupConditional, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialLight, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSensor, SerialSignalHead, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialTurnout, SerialX10Light, SignalHeadSignalMast, SimpleTimebase, SingleTurnoutSignalHead, SpecificInsteonLight, SpecificInsteonLight, SpecificLight, SpecificLight, SpecificX10Light, SpecificX10Light, SprogCSTurnout, SprogTurnout, SRCPSensor, SRCPTurnout, TamsSensor, TamsTurnout, TimeoutReporter, TimeoutRfidReporter, TimeoutRfidSensor, TrackReporter, Transit, TranspondingTag, TripleOutputSignalHead, TripleTurnoutSignalHead, TurnoutSignalMast, VirtualSignalHead, VirtualSignalMast, Warrant, XBeeLight, XBeeSensor, XBeeTurnout, XNetLight, XNetSensor, XNetTurnout, XpaTurnout, Z21CanReporter, Z21CanSensor, Z21Reporter, Z21RMBusSensor, Z21XNetTurnout, ZTC611XNetTurnout

public interface NamedBean
extends Comparable<NamedBean>, PropertyChangeProvider
Provides common services for classes representing objects on the layout, and allows a common form of access by their Managers.

Each object has two types of names:

The "system" name is provided by the system-specific implementations, and provides a unique mapping to the layout control system (for example LocoNet or NCE) and address within that system. It must be present and unique across the JMRI instance. Two beans are identical if they have the same system name; if not, not.

The "user" name is optional. It's free form text except for two restrictions:

  • It can't be the empty string "". (A non-existant user name is coded as a null)
  • And eventually, we may insist on normalizing user names to a specific form, e.g. remove leading and trailing white space; see the normalizeUserName(java.lang.String) method

Each of these two names must be unique for every NamedBean of the same type on the layout and a single NamedBean cannot have a user name that is the same as the system name of another NamedBean of the same type. (The complex wording is saying that a single NamedBean object is allowed to have its system name and user name be the same, but that's the only non-uniqueness that's allowed within a specific type). Note that the uniqueness restrictions are currently not completely enforced, only warned about; a future version of JMRI will enforce this restriction.

For more information, see the Names and Naming page in the Technical Info pages.


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.

See Also:
Manager