Package jmri

Interface SignalMastManager

    • Method Detail

      • dispose

        void dispose()
        Free resources when no longer used. Specifically, remove all references to and from this object, so it can be garbage-collected.
        Specified by:
        dispose in interface Manager<SignalMast>
      • getSignalMast

        SignalMast getSignalMast​(@Nonnull
                                 java.lang.String name)
        Get an existing SignalMast or return null if it doesn't exist. Locates via user name, then system name if needed.
        name - User name or system name to match
        null if no match found
      • provideSignalMast

        SignalMast provideSignalMast​(@Nonnull
                                     java.lang.String name)
                              throws java.lang.IllegalArgumentException
        Get the SignalMast with the user name, then system name if needed; if that fails, create a new SignalMast. If the name is a valid system name, it will be used for the new SignalMast.
        name - User name, system name, or address which can be promoted to system name
        never null
        java.lang.IllegalArgumentException - if SignalMast doesn't already exist and the manager cannot create the SignalMast due to an illegal name or name that can't be parsed
      • provideCustomSignalMast

        SignalMast provideCustomSignalMast​(@Nonnull
                                           java.lang.String systemName,
                                           java.lang.Class<? extends SignalMast> mastClass)
                                    throws JmriException
        Retrieve or create a new signal mast with a given system name. If a new object is created, it is also registered in this manager.
        systemName - the system name by which to look up the mast, or to create anew.
        mastClass - specific signal mast class. Must have a single-argument string constructor to crete it by system name.
        a registered signal mast (might be newly created),
        JmriException - if a signal mast with the given system name is already registered but it is not of the correct class, or an internal error happens during construction.