jmri
Interface Reporter

All Superinterfaces:
NamedBean
All Known Implementing Classes:
AbstractReporter, LnReporter, RpsReporter

public interface Reporter
extends NamedBean

Represent a device that can report identification information.

Reporting devices might include:

In contrast to Sensors, a Reporter provides more detailed information. A Sensor provides a status of ACTIVE or INACTIVE, while a Reporter returns an Object. The real type of that object can be whatever a particular Reporter finds useful to report. Typical values might be a String or Int, both of which can be displayed, printed, equated, etc.

A Reporter might also not be able to report all the time. The previous value remains available, but it's also possible to distinquish this case by using the getCurrentReport member function.


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.

Author:
Bob Jacobsen Copyright (C) 2001
See Also:
Sensor, AbstractReporter, ReporterManager, InstanceManager

Field Summary
 
Fields inherited from interface jmri.NamedBean
INCONSISTENT, UNKNOWN
 
Method Summary
 Object getCurrentReport()
          Query the current report.
 Object getLastReport()
          Query the last report.
 int getState()
          Provide an int form of the last report.
 void setReport(Object r)
          Set the report to an arbitrary object.
 
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, dispose, getComment, getNumPropertyChangeListeners, getSystemName, getUserName, removePropertyChangeListener, setComment, setState, setUserName
 

Method Detail

getLastReport

Object getLastReport()
Query the last report. This will return a value even if there's no current report available.


getCurrentReport

Object getCurrentReport()
Query the current report. If there is no current report available (e.g. the reporting hardware says no information is is currently available, this will return a null object.


setReport

void setReport(Object r)
Set the report to an arbitrary object.

A Reporter object will usually just "report"; its contents usually come from the layout, and hence are only set by lower-level implementation classes. But there are occasionally reasons to set it from inside the program, e.g. debugging via entering values in the Reporter Table. Hence provision of this method.


getState

int getState()
Provide an int form of the last report.

Specified by:
getState in interface NamedBean


Copyright © 1997 - 2008 JMRI Community.
JMRI, DecoderPro, PanelPro, SoundPro, DispatcherPro and associated logos are our trademarks.

Additional information on copyright, trademarks and licenses is linked here.
Site hosted by: SourceForge_Logo