Class TurnoutSignalMast

  • All Implemented Interfaces:
    java.beans.VetoableChangeListener, java.lang.Comparable<NamedBean>, java.util.EventListener, PropertyChangeProvider, NamedBean, Signal, SignalMast

    public class TurnoutSignalMast
    extends AbstractSignalMast
    SignalMast implemented via Turnout objects.

    A SignalMast that is built up using turnouts to control a specific appearance. System name specifies the creation information:

     IF$tsm:basic:one-searchlight(IT1)(IT2)
     
    The name is a colon-separated series of terms:
    • IF$tsm - defines signal masts of this type
    • basic - name of the signaling system
    • one-searchlight - name of the particular aspect map
    • (IT1)(IT2) - colon-separated list of names for Turnouts
    • Constructor Detail

      • TurnoutSignalMast

        public TurnoutSignalMast​(java.lang.String systemName,
                                 java.lang.String userName)
    • Method Detail

      • setUnLitTurnout

        public void setUnLitTurnout​(java.lang.String turnoutName,
                                    int turnoutState)
      • getTurnoutName

        public java.lang.String getTurnoutName​(java.lang.String appearance)
      • getTurnoutState

        public int getTurnoutState​(java.lang.String appearance)
      • setTurnout

        public void setTurnout​(java.lang.String appearance,
                               java.lang.String turn,
                               int state)
      • resetPreviousStates

        public void resetPreviousStates​(boolean boo)
        If the signal mast driver requires the previous state to be cleared down before the next state is set.
        Parameters:
        boo - true if prior states should be cleared; false otherwise
      • setLastRef

        protected static void setLastRef​(int newVal)
        Parameters:
        newVal - for ordinal of all TurnoutSignalMasts in use
      • getLastRef

        public static int getLastRef()
        Returns:
        highest ordinal of all TurnoutSignalMasts in use
      • 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