- All Implemented Interfaces:
public class TimeoutReporter extends AbstractNamedBeanDecorator implements Reporter, IdTagListener, PropertyChangeListener
This decorator causes the current report to be reset to nullified after a preset time period. This is to be used for reporter hardware that reports a value, but never reports the value is cleared (e.g. most RFID readers).
This file is part of JMRI.
based on TimeoutRfidReporter originally implemented by Matthew Harris
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. Based
Nested Class Summary
Fields inherited from class jmri.implementation.decorators.AbstractNamedBeanDecorator
Modifier and Type Method Description
dispose()Deactivate this object, so that it releases as many resources as possible and no longer effects others.
getCurrentReport()Query the current report.
getLastReport()Query the last report.
getState()Provide an integer form of the last report.
propertyChange(PropertyChangeEvent evt)Intercepts property change events from the underlying reporter and forwards them to property change listeners for this reporter.
setReport(Object r)Set the report to an arbitrary object.
setState(int i)Provide generic access to internal state.
Methods inherited from class jmri.implementation.decorators.AbstractNamedBeanDecorator
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, describeState, equals, firePropertyChange, getBeanType, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, 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, getBeanType, getComment, getDisplayName, getDisplayName, getFullyFormattedDisplayName, getFullyFormattedDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
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.
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.
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.
public int getState()Provide an integer form of the last report.
public void dispose()Description copied from interface:
NamedBeanDeactivate this object, so that it releases as many resources as possible and no longer effects others.
For example, if this object has listeners, after a call to this method it should no longer notify those listeners. Any native or system-wide resources it maintains should be released, including threads, files, etc.
It is an error to invoke any other methods on this object once dispose() has been called. Note, however, that there is no guarantee about behavior in that case.
Afterwards, references to this object may still exist elsewhere, preventing its garbage collection. But it's formally dead, and shouldn't be keeping any other objects alive. Therefore, this method should null out any references to other objects that this NamedBean contained.
Description copied from interface:
NamedBeanProvide generic access to internal state.
This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.
Intercepts property change events from the underlying reporter and forwards them to property change listeners for this reporter.