Class DefaultIdTag
- java.lang.Object
- 
- jmri.implementation.AbstractNamedBean
- 
- jmri.implementation.AbstractIdTag
- 
- jmri.implementation.DefaultIdTag
 
 
 
- 
- All Implemented Interfaces:
- java.lang.Comparable<NamedBean>,- PropertyChangeProvider,- IdTag,- NamedBean,- Reportable
 - Direct Known Subclasses:
- DefaultRailCom,- TranspondingTag
 
 public class DefaultIdTag extends AbstractIdTag Concrete implementation of theIdTaginterface for the Internal system.
 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.NamedBeanNamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException
 
- 
 - 
Field SummaryFields Modifier and Type Field Description static java.lang.StringPROPERTY_WHEN_LAST_SEENstatic java.lang.StringPROPERTY_WHERE_LAST_SEEN- 
Fields inherited from class jmri.implementation.AbstractIdTagprefix, whenLastSeen, whereLastSeen
 - 
Fields inherited from class jmri.implementation.AbstractNamedBeanlistenerRefs, mSystemName, register
 - 
Fields inherited from interface jmri.NamedBeanDISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN
 
- 
 - 
Constructor SummaryConstructors Constructor Description DefaultIdTag(java.lang.String systemName)DefaultIdTag(java.lang.String systemName, java.lang.String userName)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(NamedBean n2)Provide a comparison between the system names of two beans.intgetState()Provide generic access to internal state.voidload(org.jdom2.Element e)Load an idtag xml element.voidsetState(int s)Provide generic access to internal state.voidsetWhereLastSeen(Reporter r)Set the Reporter that last saw this tag.org.jdom2.Elementstore(boolean storeState)Store the contents of this IdTag object as an XML element- 
Methods inherited from class jmri.implementation.AbstractIdTaggetBeanType, getTagID, getWhenLastSeen, getWhereLastSeen, toReportString
 - 
Methods inherited from class jmri.implementation.AbstractNamedBeanaddPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChange
 - 
Methods inherited from class java.lang.Objectclone, finalize, getClass, notify, notifyAll, wait, wait, wait
 - 
Methods inherited from interface jmri.NamedBeanaddPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
 - 
Methods inherited from interface jmri.beans.PropertyChangeProvideraddPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
 
- 
 
- 
- 
- 
Field Detail- 
PROPERTY_WHEN_LAST_SEENpublic static final java.lang.String PROPERTY_WHEN_LAST_SEEN - See Also:
- Constant Field Values
 
 - 
PROPERTY_WHERE_LAST_SEENpublic static final java.lang.String PROPERTY_WHERE_LAST_SEEN - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
DefaultIdTagpublic DefaultIdTag(java.lang.String systemName) 
 - 
DefaultIdTagpublic DefaultIdTag(java.lang.String systemName, java.lang.String userName) 
 
- 
 - 
Method Detail- 
compareTopublic int compareTo(NamedBean n2) Description copied from interface:NamedBeanProvide a comparison between the system names of two beans. This provides a implementation for e.g.Comparator. Returns 0 if the names are the same, -1 if the first argument orders before the second argument's name, +1 if the first argument's name orders after the second argument's name. The comparison is alphanumeric on the system prefix, then alphabetic on the type letter, then system-specific comparison on the two suffix parts via theNamedBean.compareSystemNameSuffix(java.lang.String, java.lang.String, jmri.NamedBean)method.- Parameters:
- n2- The second NamedBean in the comparison ("this" is the first one)
- Returns:
- -1,0,+1 for ordering if the names are well-formed; may not provide proper ordering if the names are not well-formed.
 
 - 
setWhereLastSeenpublic final void setWhereLastSeen(@CheckForNull Reporter r) Description copied from interface:IdTagSet the Reporter that last saw this tag.Also sets the Date/Time when last seen - Parameters:
- r- Reporter object where last seen
- See Also:
- IdTag.getWhereLastSeen(),- IdTag.getWhenLastSeen()
 
 - 
setStatepublic void setState(int s) throws JmriException Description copied from interface:NamedBeanProvide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read. - Parameters:
- s- the state
- Throws:
- JmriException- general error when setting the state fails
 
 - 
getStatepublic int getState() Description copied from interface:NamedBeanProvide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read. - Returns:
- the state
 
 - 
storepublic org.jdom2.Element store(boolean storeState) Description copied from interface:IdTagStore 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
 
 - 
loadpublic void load(org.jdom2.Element e) Load an idtag xml element. whenLastSeen formats accepted JMRI 5.3.6 include yyyy-MM-dd'T'HH:mm:ss.SSSX yyyy-MM-dd'T'HH:mm:ss.SSS EEE, dd MMM yyyy HH:mm:ss zzz- Parameters:
- e- element to load.
 
 
- 
 
-