Class OlcbReporter

    • Constructor Detail

      • OlcbReporter

        public OlcbReporter​(java.lang.String prefix,
                            java.lang.String address,
                            org.openlcb.OlcbInterface iface)
    • Method Detail

      • finishLoad

        void finishLoad()
        Helper function that will be invoked after construction once the properties have been loaded. Used specifically for preventing double initialization when loading sensors from XML.
      • dispose

        public void dispose()
        Description copied from class: AbstractNamedBean
        Deactivate 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.

        Specified by:
        dispose in interface NamedBean
        Overrides:
        dispose in class AbstractNamedBean
      • compareSystemNameSuffix

        @CheckReturnValue
        public int compareSystemNameSuffix​(@Nonnull
                                           java.lang.String suffix1,
                                           @Nonnull
                                           java.lang.String suffix2,
                                           @Nonnull
                                           NamedBean n)
        Compare the suffix of this NamedBean's name with the suffix of the argument NamedBean's name for the NamedBean.compareTo(jmri.NamedBean) operation. This is intended to be a system-specific comparison that understands the various formats, etc. By default, does an alphanumeric-by-chunks comparison. Sorts by decoded EventID(s)
        Specified by:
        compareSystemNameSuffix in interface NamedBean
        Overrides:
        compareSystemNameSuffix in class AbstractNamedBean
        Parameters:
        suffix1 - The suffix for the 1st bean in the comparison
        suffix2 - The suffix for the 2nd bean in the comparison
        n - The other (second) NamedBean in the comparison
        Returns:
        -1,0,+1 for ordering if the names are well-formed; may not provide proper ordering if the names are not well-formed.
      • getState

        public int getState()
        State is always an integer, which is the numeric value from the last loco address that we reported, or -1 if the last update was an exit.
        Specified by:
        getState in interface NamedBean
        Specified by:
        getState in interface Reporter
        Overrides:
        getState in class AbstractIdTagReporter
        Returns:
        loco address number or -1 if the last message specified exiting
      • setState

        public void setState​(int s)
        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.

        Specified by:
        setState in interface NamedBean
        Overrides:
        setState in class AbstractIdTagReporter
        Parameters:
        s - the state