Class SerialLight

    • Constructor Detail

      • SerialLight

        public SerialLight​(java.lang.String systemName,
                           CMRISystemConnectionMemo memo)
        Create a Light object, with only system name.

        'systemName' was previously validated in SerialLightManager

        Parameters:
        systemName - light system name.
        memo - system connection.
      • SerialLight

        public SerialLight​(java.lang.String systemName,
                           java.lang.String userName,
                           CMRISystemConnectionMemo memo)
        Create a Light object, with both system and user names.

        'systemName' was previously validated in SerialLightManager

        Parameters:
        systemName - light system name.
        userName - light username.
        memo - system connection.
    • Method Detail

      • doNewState

        protected void doNewState​(int oldState,
                                  int newState)
        Set the current state of this Light This routine requests the hardware to change. If this is really a change in state of this bit (tested in SerialNode), a Transmit packet will be sent before this Node is next polled.
        Overrides:
        doNewState in class AbstractLight
        Parameters:
        oldState - old state
        newState - new state
      • 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 node number and then by bit
        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.