Interface IdTag
- All Superinterfaces:
Comparable<NamedBean>,NamedBean,PropertyChangeProvider
- All Known Subinterfaces:
AddressedIdTag,RailCom
- All Known Implementing Classes:
AbstractIdTag,DefaultIdTag,DefaultRailCom,TranspondingTag
Examples include
- RFID-tag.
- Digitrax Transponding Decoders
- RailCom tags
Each IdTag contains the following information:
- A System Name
- A User Name (which may be null)
- A TagID
- A reference to the last reporter to see the tag, which may be null
- The date and time the last reporter saw the tag, which may be null
- A list of key/value pairs holding properties
"Seen" is defined as a Reporter has indicated that the IdTag is within the area served by that Reporter. "Seen" is not updated to a Reporter reports that the IdTag is leaving that area.
The system name is of the form "sDxxxx" where "xxxx" is the same value as the TagID and "s" is the system prefix for the relevant Reporter (for Reporter-type-specific tags) or "I" in the more general case.
The list of key value pairs is maintained by the reporters parsing and updating the list. This information may vary between implementations.
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.
- Since:
- 2.11.4
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intConstant representing a "seen" state, indicating that the tag has been seen.static final intConstant representing an "unseen" state, indicating that the ID tag has not yet been seen.Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN -
Method Summary
Modifier and TypeMethodDescriptiongetTagID()Retrieve a string representation of this tag IDReturn the Date/Time when this tag was last seen, or null if not yet seenReturn the Reporter that last saw this tag, or null if not yet seenvoidload(org.jdom2.Element e) Load contents of IdTag object from an XML elementvoidsetWhereLastSeen(Reporter reporter) Set the Reporter that last saw this tag.org.jdom2.Elementstore(boolean storeState) Store the contents of this IdTag object as an XML elementMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Field Details
-
UNSEEN
Constant representing an "unseen" state, indicating that the ID tag has not yet been seen.- See Also:
-
SEEN
Constant representing a "seen" state, indicating that the tag has been seen.To determine where this object was last seen, use:
To determine when this object was last seen, use:- See Also:
-
-
Method Details
-
getTagID
Retrieve a string representation of this tag IDThis is the system name without the identifier
- Returns:
- the tag ID
-
setWhereLastSeen
Set the Reporter that last saw this tag.Also sets the Date/Time when last seen
- Parameters:
reporter- Reporter object where last seen- See Also:
-
getWhereLastSeen
Return the Reporter that last saw this tag, or null if not yet seen- Returns:
- Reporter object where last seen, or null
-
getWhenLastSeen
Return the Date/Time when this tag was last seen, or null if not yet seen- Returns:
- Date object when last seen, or null
-
store
Store the contents of this IdTag object as an XML element- Parameters:
storeState- Determine if the state of this IdTag should be stored- Returns:
- Element with IdTag contents
-
load
Load contents of IdTag object from an XML element- Parameters:
e- Element containing IdTag details
-