|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IdTagManager
Locate an IdTag object representing a specific IdTag.
IdTag objects are obtained from an IdTagManager, which in turn is generally located from the InstanceManager. A typical call sequence might be:
IdTag tag = InstanceManager.idTagManagerInstance().newIdTag(null,"23");
Each IdTag 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, and provides a unique mapping to the layout control system (e.g. LocoNet, NCE, etc) and address within that system.
Much of the book-keeping is implemented in the AbstractIdTagManager 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.
IdTag,
InstanceManager| Field Summary |
|---|
| Fields inherited from interface jmri.Manager |
|---|
AUDIO, BLOCKBOSS, BLOCKS, CONDITIONALS, ENTRYEXIT, IDTAGS, LAYOUTBLOCKS, LIGHTS, LOGIXS, MEMORIES, OBLOCKS, PANELFILES, REPORTERS, ROUTES, SECTIONS, SENSORGROUPS, SENSORS, SIGNALGROUPS, SIGNALHEADS, SIGNALMASTLOGICS, SIGNALMASTS, TIMEBASE, TRANSITS, TURNOUTS, WARRANTS |
| Method Summary | |
|---|---|
IdTag |
getBySystemName(String systemName)
Locate an instance based on a system name. |
IdTag |
getByTagID(String tagID)
Locate an instance based on a tag ID. |
IdTag |
getByUserName(String userName)
Locate an instance based on a user name. |
IdTag |
getIdTag(String name)
Locate via tag ID, then by user name, and finally system name if needed. |
List<String> |
getSystemNameList()
Get a list of all IdTag's system names. |
List<IdTag> |
getTagsForReporter(Reporter reporter,
long threshold)
Get a list of all IdTags seen by a specified Reporter within a specific time threshold from the most recently seen. |
void |
init()
Perform initialisation |
boolean |
isFastClockUsed()
Determines if fast clock times should be recorded for when a given IdTag was last seen |
boolean |
isInitialised()
Determines if the manager has been initialised |
boolean |
isStateStored()
Determines if the state of known IdTags should be stored |
IdTag |
newIdTag(String systemName,
String userName)
Return an instance with the specified system and user names. |
IdTag |
provideIdTag(String name)
Locate via tag ID, then user name, and finally system name if needed. |
void |
setFastClockUsed(boolean fastClock)
Define if the manager should use the fast clock when setting the times when a given IdTag was last seen |
void |
setStateStored(boolean state)
Define if the manager should persist details of when and where all known IdTags were seen |
| Methods inherited from interface jmri.Manager |
|---|
addPropertyChangeListener, deregister, dispose, getBeanBySystemName, getBeanByUserName, getNamedBean, getNamedBeanList, getSystemNameArray, getSystemPrefix, getXMLOrder, makeSystemName, register, removePropertyChangeListener, systemLetter, typeLetter |
| Method Detail |
|---|
IdTag provideIdTag(String name)
name - Tag ID, user name, system name, or address which
can be promoted to system name
IllegalArgumentException - if IdTag doesn't
already exist and the manager cannot create the IdTag
due to e.g. an illegal name or name that can't be parsed.IdTag getIdTag(String name)
name - tag name being requested
IdTag getBySystemName(String systemName)
systemName - system name being requested
IdTag getByUserName(String userName)
userName - user name being requested
IdTag getByTagID(String tagID)
tagID - tag ID being requested
IdTag newIdTag(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 IdTag
due to e.g. an illegal name or name that can't be parsed.List<String> getSystemNameList()
getSystemNameList in interface Manager
List<IdTag> getTagsForReporter(Reporter reporter,
long threshold)
reporter - Reporter to return list for (can be null)threshold - Time threshold (in ms)
void setStateStored(boolean state)
state - True to store; False to omitboolean isStateStored()
void setFastClockUsed(boolean fastClock)
fastClock - True to use the fast clock; False to use the system clockboolean isFastClockUsed()
void init()
boolean isInitialised()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||