|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface MemoryManager
Locate a Memory object representing some specific information.
Memory objects are obtained from a MemoryManager, which in turn is generally located from the InstanceManager. A typical call sequence might be:
Memory memory = InstanceManager.memoryManagerInstance().provideMemory("status");
Each Memory has a two names. The "user" name is entirely free form, and can be used for any purpose. The "system" name is provided by the system-specific implementations, if any, and provides a unique mapping to the layout control system (e.g. LocoNet, NCE, etc) and address within that system. Note that most (all?) layout systems don't have anything corresponding to this, in which case the "Internal" Memory objects are still available with names like IM23.
Much of the book-keeping is implemented in the AbstractMemoryManager class, which can form the basis for a system-specific implementation.
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.
Memory,
AbstractMemoryManager,
InstanceManager| Field Summary |
|---|
| Fields inherited from interface jmri.Manager |
|---|
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS |
| Method Summary | |
|---|---|
Memory |
getBySystemName(String systemName)
Locate an instance based on a system name. |
Memory |
getByUserName(String userName)
Locate an instance based on a user name. |
Memory |
getMemory(String name)
Locate via user name, then system name if needed. |
List<String> |
getSystemNameList()
Get a list of all Memory objects' system names. |
Memory |
newMemory(String userName)
For use with User GUI, to allow the auto generation of systemNames, where the user can optionally supply a username. |
Memory |
newMemory(String systemName,
String userName)
Return an instance with the specified system and user names. |
Memory |
provideMemory(String name)
Locate via user name, then system name if needed. |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, dispose, getBeanBySystemName, getSystemNameArray, getSystemPrefix, getXMLOrder, makeSystemName, register, removePropertyChangeListener, systemLetter, typeLetter |
| Method Detail |
|---|
Memory provideMemory(String name)
name - User name, system name, or address which
can be promoted to system name
IllegalArgumentException - if Memory doesn't
already exist and the manager cannot create the Memory
due to e.g. an illegal name or name that can't be parsed.Memory getMemory(String name)
name -
Memory getBySystemName(String systemName)
Memory getByUserName(String userName)
Memory newMemory(String systemName,
String userName)
This will always return a valid object reference; a new object will be created if necessary. In that case:
IllegalArgumentException - if cannot create the Memory
due to e.g. an illegal name or name that can't be parsed.Memory newMemory(String userName)
This will always return a valid object reference; a new object will be created if necessary. ( If a null reference is given for user name, no user name will be associated with the Memory object created Note that it is possible to make an inconsistent request if both addresses are provided, but the given values are associated with different objects. This is a problem, and we don't have a good solution except to issue warnings. This will mostly happen if you're creating Memory objects when you should be looking them up.
IllegalArgumentException - if cannot create the Memory
due to e.g. an illegal name or name that can't be parsed.List<String> getSystemNameList()
getSystemNameList in interface Manager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||