Interface FemaleSocket

    • Method Detail

      • disconnect

        void disconnect()
        Disconnect the current connected male socket from this female socket.
      • canDisconnect

        default boolean canDisconnect()
        Can a connected socket be disconnected?
        Returns:
        true if the socket can be disconnected, false otherwise
      • isConnected

        boolean isConnected()
        Is a male socket connected to this female socket?
        Returns:
        true if connected
      • isCompatible

        boolean isCompatible​(MaleSocket socket)
        Is a particular male socket compatible with this female socket?
        Parameters:
        socket - the male socket
        Returns:
        true if the male socket can be connected to this female socket
      • validateName

        default boolean validateName​(java.lang.String name)
        Validates a name for a FemaleSocket.

        The name must have at least one character and only alphanumeric characters. The first character must not be a digit.

        Parameters:
        name - the name
        Returns:
        true if the name is valid, false otherwise
      • validateName

        boolean validateName​(java.lang.String name,
                             boolean ignoreDuplicateErrors)
        Validates a name for a FemaleSocket.

        The name must have at least one character and only alphanumeric characters. The first character must not be a digit.

        Parameters:
        name - the name
        ignoreDuplicateErrors - true if duplicate names should be ignored, false otherwise
        Returns:
        true if the name is valid, false otherwise
      • setName

        default void setName​(java.lang.String name)
        Set the name of this socket.

        The name must have at least one character and only alphanumeric characters. The first character must not be a digit.

        Parameters:
        name - the name
      • setName

        void setName​(java.lang.String name,
                     boolean ignoreDuplicateErrors)
        Set the name of this socket.

        The name must have at least one character and only alphanumeric characters. The first character must not be a digit.

        Parameters:
        name - the name
        ignoreDuplicateErrors - true if duplicate names should be ignored, false otherwise
      • isSocketOperationAllowed

        default boolean isSocketOperationAllowed​(FemaleSocketOperation oper)
        Is the operation allowed on this socket?
        Parameters:
        oper - the operation to do
        Returns:
        true if operation is allowed, false otherwise
      • setEnableListeners

        void setEnableListeners​(boolean enable)
        Sets whenever listeners are enabled or not. ConditionalNG has always listeners enabled, but Clipboard and Module has never listeners enabled.
        Parameters:
        enable - true if listeners should be enabled, false otherwise
      • getEnableListeners

        boolean getEnableListeners()
        Gets whenever listeners are enabled or not. ConditionalNG has always listeners enabled, but Clipboard and Module has never listeners enabled.
        Returns:
        true if listeners should be enabled, false otherwise
      • isAncestor

        default boolean isAncestor​(MaleSocket maleSocket)
        Am I an ancestor to this maleSocket?
        Parameters:
        maleSocket - the maleSocket that could be a child
        Returns:
        true if this oject is an ancestor to the maleSocket object
      • getConnectableClasses

        java.util.Map<Category,​java.util.List<java.lang.Class<? extends Base>>> getConnectableClasses()
        Get a set of classes that are compatible with this female socket.
        Returns:
        a set of entries with category and class
      • setup

        default void setup()
        Setup this object and its children. This method is used to lookup system names for child sockets, turnouts, sensors, and so on.
        Specified by:
        setup in interface Base