Interface IdTag
-
- All Superinterfaces:
java.lang.Comparable<NamedBean>
,NamedBean
,PropertyChangeProvider
- All Known Subinterfaces:
AddressedIdTag
,RailCom
- All Known Implementing Classes:
AbstractIdTag
,DefaultIdTag
,DefaultRailCom
,TranspondingTag
public interface IdTag extends NamedBean
IdTag is a pre-parsed representation of an identification message from the layout. One use of an IdTag is a device that might be attached to any specific piece of rolling stock to uniquely identify it.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
Fields Modifier and Type Field Description static int
SEEN
Constant representing a "seen" state, indicating that the tag has been seen.static int
UNSEEN
Constant 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_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.String
getTagID()
Retrieve a string representation of this tag IDjava.util.Date
getWhenLastSeen()
Return the Date/Time when this tag was last seen, or null if not yet seenReporter
getWhereLastSeen()
Return the Reporter that last saw this tag, or null if not yet seenvoid
load(org.jdom2.Element e)
Load contents of IdTag object from an XML elementvoid
setWhereLastSeen(Reporter reporter)
Set the Reporter that last saw this tag.org.jdom2.Element
store(boolean storeState)
Store the contents of this IdTag object as an XML element-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getState, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setState, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Field Detail
-
UNSEEN
static final int UNSEEN
Constant representing an "unseen" state, indicating that the ID tag has not yet been seen.- See Also:
- Constant Field Values
-
SEEN
static final int 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:
- Constant Field Values
-
-
Method Detail
-
getTagID
@Nonnull java.lang.String getTagID()
Retrieve a string representation of this tag IDThis is the system name without the identifier
- Returns:
- the tag ID
-
setWhereLastSeen
void setWhereLastSeen(Reporter reporter)
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()
,getWhenLastSeen()
-
getWhereLastSeen
@CheckForNull Reporter getWhereLastSeen()
Return the Reporter that last saw this tag, or null if not yet seen- Returns:
- Reporter object where last seen, or null
-
getWhenLastSeen
@CheckForNull java.util.Date 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
org.jdom2.Element store(boolean storeState)
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
-
-