Package jmri.implementation
Class AbstractIdTagReporter
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.implementation.AbstractReporter
jmri.implementation.AbstractIdTagReporter
- All Implemented Interfaces:
Comparable<NamedBean>,PropertyChangeProvider,IdTagListener,NamedBean,PhysicalLocationReporter,Reporter
- Direct Known Subclasses:
AbstractRailComReporter,LnReporter,MqttReporter,OlcbReporter,RfidReporter
public class AbstractIdTagReporter
extends AbstractReporter
implements IdTagListener, PhysicalLocationReporter
Extend AbstractReporter for IdTag reporters
This file is based on RfidReporter
- Since:
- 4.15.3
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameExceptionNested classes/interfaces inherited from interface jmri.PhysicalLocationReporter
PhysicalLocationReporter.Direction -
Field Summary
Fields inherited from class jmri.implementation.AbstractReporter
_currentReport, _lastReportFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWNFields inherited from interface jmri.Reporter
PROPERTY_COLLECTION, PROPERTY_CURRENT_REPORT, PROPERTY_LAST_REPORT, PROPERTY_REPORT_METADATA -
Constructor Summary
ConstructorsConstructorDescriptionAbstractIdTagReporter(String systemName) AbstractIdTagReporter(String systemName, String userName) -
Method Summary
Modifier and TypeMethodDescriptiondescribeState(int state) Provide human-readable, localized version of state value.getDirection(String rep) Gets the direction (ENTER/EXIT) of the report.getLocoAddress(String rep) Get the locomotive address we're reporting about from the current report.Get the PhysicalLocation of the Reporter Reports its own location, for now.Get the PhysicalLocation of the Reporter.intgetState()Provide an integer form of the last report.booleanIndicates whether the underlying hardware sends messages determining when an Id is no longer in this reporter (e.g.voidvoidnotifySeenElsewhere(IdTag tag, Reporter newReporter) Informs this reporter that a tag previously reported here has been seen at another reporter.voidProvide a general method for updating the report.voidsetState(int s) Provide generic access to internal state.Methods inherited from class jmri.implementation.AbstractReporter
getBeanType, getCurrentReport, getLastReport, notifyCollectionUpdatedMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, dispose, equals, firePropertyChange, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
AbstractIdTagReporter
-
AbstractIdTagReporter
-
-
Method Details
-
hasExitReports
Indicates whether the underlying hardware sends messages determining when an Id is no longer in this reporter (e.g. RailCom block occupancy exit events).When
false(e.g. RFID point detectors), seeing a tag elsewhere implies it has departed this reporter. Whentrue, departure is strictly governed by hardware exit/clear messages.- Returns:
- true if hardware sends explicit exit/departure messages; false otherwise.
-
notify
- Specified by:
notifyin interfaceIdTagListener
-
setReport
Provide a general method for updating the report.- Specified by:
setReportin interfaceReporter- Overrides:
setReportin classAbstractReporter- Parameters:
r- the report
-
notifySeenElsewhere
Informs this reporter that a tag previously reported here has been seen at another reporter.Default implementation is a no-op for generic reporters.
- Specified by:
notifySeenElsewherein interfaceReporter- Overrides:
notifySeenElsewherein classAbstractReporter- Parameters:
tag- the tag seen elsewherenewReporter- the reporter where the tag was newly detected
-
setState
Provide 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.
-
getState
Provide an integer form of the last report. -
describeState
Provide human-readable, localized version of state value.This method is intended for use when presenting to a human operator.
- Specified by:
describeStatein interfaceNamedBean- Overrides:
describeStatein classAbstractNamedBean- Parameters:
state- the state to describe- Returns:
- the state in localized form
-
getLocoAddress
Get the locomotive address we're reporting about from the current report.- Specified by:
getLocoAddressin interfacePhysicalLocationReporter- Parameters:
rep- ignored, IdTag Reporters don't send String type reports.
-
getDirection
Gets the direction (ENTER/EXIT) of the report.Because of the way IdTag Reporters work, all reports are ENTER type.
- Specified by:
getDirectionin interfacePhysicalLocationReporter
-
getPhysicalLocation
Get the PhysicalLocation of the Reporter Reports its own location, for now. Not sure if that's the right thing or not. NOT DONE YET- Specified by:
getPhysicalLocationin interfacePhysicalLocationReporter
-
getPhysicalLocation
Get the PhysicalLocation of the Reporter.- Specified by:
getPhysicalLocationin interfacePhysicalLocationReporter- Parameters:
s- unused.
-