Class AbstractReporter

java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractReporter
All Implemented Interfaces:
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

  • Field Details

  • Constructor Details

  • Method Details

    • getBeanType

      public 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 interface NamedBean
      Returns:
      a string of the bean type, eg Turnout, Sensor etc
    • 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 interface Reporter
      Returns:
      the current report or null
    • 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 interface Reporter
      Returns:
      the last report or null
    • setReport

      public void setReport(Object r)
      Provide a general method for updating the report.
      Specified by:
      setReport in interface Reporter
      Parameters:
      r - the report