Class NBHSignal


  • public class NBHSignal
    extends java.lang.Object
    Provide access to both signal masts and signal heads for the CTC system.

    This class combines the NBHAbstractSignalCommon, NBHSignalMast and NBHSignalHead classes. OtherData _mSignalSystemType determines whether masts or heads are enabled.

    • Constructor Detail

      • NBHSignal

        public NBHSignal​(java.lang.String signal)
        Create the named bean handle for either a signal mast or signal head.
        Parameters:
        signal - The signal name.
    • Method Detail

      • valid

        public boolean valid()
      • getBean

        public java.lang.Object getBean()
      • getHandleName

        public java.lang.String getHandleName()
        Returns:
        The signal's handle name.
      • setCTCHeld

        public void setCTCHeld​(boolean held)
      • getHeld

        public boolean getHeld()
      • setHeld

        public void setHeld​(boolean newHeld)
      • getAspect

        public java.lang.String getAspect()
        Function to insure that a non null aspect value is always returned to the caller. Background (regarding the value contained in "_mDangerAppearance"): In this objects constructor, "_mDangerAppearance" is set to getAppearanceMap().getSpecificAppearance(SignalAppearanceMap.DANGER). If "...getSpecificAppearance..." returns "null" (undocumented in JMRI documents as of 9/18/2019), "_mDangerAppearance" is set to "Stop" for safety. So "_mDangerAppearance" will NEVER be null for use as follows: SignalMast.getAspect() can return "null" (undocumented in JMRI documents as of 9/18/2019) if (for instance) the signal has no rules (i.e. no "Discover" done yet, or the signal is shown on the screen as a big red "X"). In this case, we return "_mDangerAppearance".
        Returns:
        Return a guaranteed non null aspect name.
      • setAppearance

        public void setAppearance​(int newAppearance)
      • getValidStates

        public int[] getValidStates()
        Get an array of appearance indexes valid for the mast type.
        Returns:
        array of appearance state values available on this mast type
      • getValidStateKeys

        public java.lang.String[] getValidStateKeys()
        Get an array of non-localized appearance keys valid for the mast type. For GUI application consider using (capitalized) getValidStateNames()
        Returns:
        array of translated appearance names available on this mast type
      • getValidStateNames

        public java.lang.String[] getValidStateNames()
        Get an array of localized appearance descriptions valid for the mast type. For persistance and comparison consider using getValidStateKeys()
        Returns:
        array of translated appearance names