Package jmri.implementation
Class AbstractReporter
- java.lang.Object
-
- jmri.implementation.AbstractNamedBean
-
- jmri.implementation.AbstractReporter
-
- All Implemented Interfaces:
java.lang.Comparable<NamedBean>
,PropertyChangeProvider
,NamedBean
,Reporter
- Direct Known Subclasses:
AbstractIdTagReporter
,EcosReporter
,JMRIClientReporter
,RpsReporter
,TrackReporter
public abstract class AbstractReporter extends AbstractNamedBean implements Reporter
Abstract base for the Reporter interface.Implements the parameter binding support.
Note that we consider it an error for there to be more than one object that corresponds to a particular physical Reporter on the layout. Abstract class providing the basic logic of the Reporter interface
-
-
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.Object
_currentReport
protected java.lang.Object
_lastReport
-
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 AbstractReporter(java.lang.String systemName)
AbstractReporter(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.Object
getCurrentReport()
Query the current report.java.lang.Object
getLastReport()
Query the last report.void
setReport(java.lang.Object r)
Provide a general method for updating the report.-
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.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, 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
-
_lastReport
protected java.lang.Object _lastReport
-
_currentReport
protected java.lang.Object _currentReport
-
-
Constructor Detail
-
AbstractReporter
public AbstractReporter(java.lang.String systemName)
-
AbstractReporter
public AbstractReporter(java.lang.String systemName, java.lang.String userName)
-
-
Method Detail
-
getBeanType
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
-
getCurrentReport
public java.lang.Object getCurrentReport()
Description copied from interface:Reporter
Query the current report. If there is no current report available (e.g. the reporting hardware says no information is currently available) this will return a null object.- Specified by:
getCurrentReport
in interfaceReporter
- Returns:
- the current report or null
-
getLastReport
public java.lang.Object getLastReport()
Description copied from interface:Reporter
Query the last report. This will return a value even if there's no current report available. If there is a current report, both this and the current report will be equal. If nothing has ever been reported, this will return a null object.- Specified by:
getLastReport
in interfaceReporter
- Returns:
- the last report or null
-
-