Package jmri

Interface IdTag

All Superinterfaces:
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
  • Field Details

  • Method Details

    • getTagID

      Retrieve a string representation of this tag ID

      This 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

      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

      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
    • load

      void load(@Nonnull org.jdom2.Element e)
      Load contents of IdTag object from an XML element
      Parameters:
      e - Element containing IdTag details