Package jmri.implementation
Class AbstractIdTag
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractIdTag
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>,PropertyChangeProvider,IdTag,NamedBean,Reportable
- Direct Known Subclasses:
DefaultIdTag
public abstract class AbstractIdTag extends AbstractNamedBean implements IdTag, Reportable
Abstract implementation ofIdTagcontaining code common to all concrete implementations. This implementation implementsReportable.- 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 protected java.lang.Stringprefixprotected java.util.DatewhenLastSeenprotected ReporterwhereLastSeen-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
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
-
-
Constructor Summary
Constructors Constructor Description AbstractIdTag(java.lang.String systemName)AbstractIdTag(java.lang.String systemName, java.lang.String userName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBeanType()For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.java.lang.StringgetTagID()Retrieve a string representation of this tag IDjava.util.DategetWhenLastSeen()Return the Date/Time when this tag was last seen, or null if not yet seenReportergetWhereLastSeen()Return the Reporter that last saw this tag, or null if not yet seenjava.lang.StringtoReportString()The IDTag version of toReportString returns a string consisting of the user name (if defined) or Tag ID followed by the associated list of property values.-
Methods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, 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.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jmri.IdTag
load, setWhereLastSeen, store
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, 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
-
whereLastSeen
protected Reporter whereLastSeen
-
whenLastSeen
protected java.util.Date whenLastSeen
-
prefix
protected java.lang.String prefix
-
-
Constructor Detail
-
AbstractIdTag
public AbstractIdTag(java.lang.String systemName)
-
AbstractIdTag
public AbstractIdTag(java.lang.String systemName, java.lang.String userName)
-
-
Method Detail
-
getTagID
@Nonnull public java.lang.String getTagID()
Description copied from interface:IdTagRetrieve a string representation of this tag IDThis is the system name without the identifier
-
getWhereLastSeen
public Reporter getWhereLastSeen()
Description copied from interface:IdTagReturn the Reporter that last saw this tag, or null if not yet seen- Specified by:
getWhereLastSeenin interfaceIdTag- Returns:
- Reporter object where last seen, or null
-
getWhenLastSeen
public java.util.Date getWhenLastSeen()
Description copied from interface:IdTagReturn the Date/Time when this tag was last seen, or null if not yet seen- Specified by:
getWhenLastSeenin interfaceIdTag- Returns:
- Date object when last seen, or null
-
toReportString
public java.lang.String toReportString()
The IDTag version of toReportString returns a string consisting of the user name (if defined) or Tag ID followed by the associated list of property values.- Specified by:
toReportStringin interfaceReportable- Returns:
- a report string representing the Object.
-
getBeanType
@Nonnull public java.lang.String getBeanType()
Description copied from interface:NamedBeanFor instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanTypein interfaceNamedBean- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
-