Package jmri.jmrit.logixng
Interface FemaleSocket
-
- All Superinterfaces:
Base
,PropertyChangeProvider
- All Known Subinterfaces:
FemaleAnalogActionSocket
,FemaleAnalogExpressionSocket
,FemaleAnySocket
,FemaleDigitalActionSocket
,FemaleDigitalBooleanActionSocket
,FemaleDigitalExpressionSocket
,FemaleGenericExpressionSocket
,FemaleStringActionSocket
,FemaleStringExpressionSocket
- All Known Implementing Classes:
AbstractFemaleSocket
,DefaultFemaleAnalogActionSocket
,DefaultFemaleAnalogExpressionSocket
,DefaultFemaleAnySocket
,DefaultFemaleDigitalActionSocket
,DefaultFemaleDigitalBooleanActionSocket
,DefaultFemaleDigitalExpressionSocket
,DefaultFemaleGenericExpressionSocket
,DefaultFemaleStringActionSocket
,DefaultFemaleStringExpressionSocket
public interface FemaleSocket extends Base
A LogixNG female expression socket. A Expression or a Action that has children must not use these directly but instead use a FemaleSocket.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Base
Base.PrintTreeSettings, Base.RunnableWithBase, Base.RunnableWithBaseThrowException
-
-
Field Summary
-
Fields inherited from interface jmri.jmrit.logixng.Base
PRINT_LINE_NUMBERS_FORMAT, PROPERTY_CHILD_COUNT, PROPERTY_CHILD_REORDER, PROPERTY_LAST_RESULT_CHANGED, PROPERTY_SOCKET_CONNECTED, PROPERTY_SOCKET_DISCONNECTED, SEPARATOR, SOCKET_CONNECTED, SOCKET_DISCONNECTED
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default boolean
canDisconnect()
Can a connected socket be disconnected?void
connect(MaleSocket socket)
Connect the male socket to this female socket.void
disconnect()
Disconnect the current connected male socket from this female socket.default void
doSocketOperation(FemaleSocketOperation oper)
Do an operation on this socketjava.util.Map<Category,java.util.List<java.lang.Class<? extends Base>>>
getConnectableClasses()
Get a set of classes that are compatible with this female socket.MaleSocket
getConnectedSocket()
Get the connected socket.boolean
getEnableListeners()
Gets whenever listeners are enabled or not.java.lang.String
getName()
Get the name of this socket.default boolean
isAncestor(MaleSocket maleSocket)
Am I an ancestor to this maleSocket?boolean
isCompatible(MaleSocket socket)
Is a particular male socket compatible with this female socket?boolean
isConnected()
Is a male socket connected to this female socket?default boolean
isSocketOperationAllowed(FemaleSocketOperation oper)
Is the operation allowed on this socket?void
setEnableListeners(boolean enable)
Sets whenever listeners are enabled or not.default void
setName(java.lang.String name)
Set the name of this socket.void
setName(java.lang.String name, boolean ignoreDuplicateErrors)
Set the name of this socket.default void
setup()
Setup this object and its children.default boolean
validateName(java.lang.String name)
Validates a name for a FemaleSocket.boolean
validateName(java.lang.String name, boolean ignoreDuplicateErrors)
Validates a name for a FemaleSocket.-
Methods inherited from interface jmri.jmrit.logixng.Base
addPropertyChangeListener, addPropertyChangeListener, deepCopyChildren, dispose, doSocketOperation, existsInTree, forEntireTree, forEntireTreeWithException, getCategory, getChild, getChildCount, getComment, getConditionalNG, getDeepCopy, getListenerRef, getListenerRefs, getListenerRefsIncludingChildren, getLogixNG, getLongDescription, getLongDescription, getModule, getNumPropertyChangeListeners, getParent, getPropertyChangeListenersByReference, getRoot, getShortDescription, getShortDescription, getSystemName, getUsageDetail, getUsageTree, getUserName, hasChild, isActive, isEnabled, isSocketOperationAllowed, printTree, printTree, printTree, printTree, printTree, registerListeners, setComment, setParent, setParentForAllChildren, setUserName, unregisterListeners, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
connect
void connect(MaleSocket socket) throws SocketAlreadyConnectedException
Connect the male socket to this female socket.- Parameters:
socket
- the socket to connect- Throws:
SocketAlreadyConnectedException
- if the socket is already connected
-
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
-
getConnectedSocket
MaleSocket getConnectedSocket()
Get the connected socket.- Returns:
- the male socket or null if not connected
-
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 nameignoreDuplicateErrors
- 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 nameignoreDuplicateErrors
- true if duplicate names should be ignored, false otherwise
-
getName
@CheckForNull java.lang.String getName()
Get the name of this socket.- Returns:
- the name
-
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
-
doSocketOperation
default void doSocketOperation(FemaleSocketOperation oper)
Do an operation on this socket- Parameters:
oper
- the operation to do
-
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
-
-