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 ofIdTag
containing 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.String
prefix
protected java.util.Date
whenLastSeen
protected Reporter
whereLastSeen
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, 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.String
getBeanType()
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.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 seenjava.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.-
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, 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:IdTag
Retrieve a string representation of this tag IDThis is the system name without the identifier
-
getWhereLastSeen
public Reporter getWhereLastSeen()
Description copied from interface:IdTag
Return the Reporter that last saw this tag, or null if not yet seen- Specified by:
getWhereLastSeen
in interfaceIdTag
- Returns:
- Reporter object where last seen, or null
-
getWhenLastSeen
public java.util.Date getWhenLastSeen()
Description copied from interface:IdTag
Return the Date/Time when this tag was last seen, or null if not yet seen- Specified by:
getWhenLastSeen
in 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:
toReportString
in interfaceReportable
- Returns:
- a report string representing the Object.
-
getBeanType
@Nonnull public java.lang.String getBeanType()
Description copied from interface:NamedBean
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.- Specified by:
getBeanType
in interfaceNamedBean
- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
-