Class DefaultFemaleGenericExpressionSocket
- java.lang.Object
-
- jmri.jmrit.logixng.implementation.AbstractFemaleSocket
-
- jmri.jmrit.logixng.implementation.DefaultFemaleGenericExpressionSocket
-
- All Implemented Interfaces:
PropertyChangeProvider,Base,FemaleGenericExpressionSocket,FemaleSocket,FemaleSocketListener
public class DefaultFemaleGenericExpressionSocket extends AbstractFemaleSocket implements FemaleGenericExpressionSocket, FemaleSocketListener
Default implementation of the FemaleGenericExpressionSocket
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Base
Base.PrintTreeSettings, Base.RunnableWithBase, Base.RunnableWithBaseThrowException
-
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.FemaleGenericExpressionSocket
FemaleGenericExpressionSocket.SocketType
-
-
Field Summary
-
Fields inherited from class jmri.jmrit.logixng.implementation.AbstractFemaleSocket
_enableListeners, _listener
-
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
-
-
Constructor Summary
Constructors Constructor Description DefaultFemaleGenericExpressionSocket(FemaleGenericExpressionSocket.SocketType socketType, Base parent, FemaleSocketListener listener, java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidconnect(MaleSocket socket)Connect the male socket to this female socket.voidconnected(FemaleSocket socket)The socket is connected.voiddisconnect()Disconnect the current connected male socket from this female socket.voiddisconnected(FemaleSocket socket)The socket is disconnected.voiddisposeMe()java.lang.ObjectevaluateGeneric()Evaluate this expression.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.MaleSocketgetConnectedSocket()Get the connected socket.FemaleSocketgetCurrentActiveSocket()Get the current active socket.booleangetDoI18N()java.lang.StringgetLongDescription(java.util.Locale locale)Get a long description of this item.java.lang.StringgetShortDescription(java.util.Locale locale)Get a short description of this item.FemaleGenericExpressionSocket.SocketTypegetSocketType()Get the type of the socket.booleanisCompatible(MaleSocket socket)Is a particular male socket compatible with this female socket?booleanisConnected()Is a male socket connected to this female socket?voidsetDoI18N(boolean do_i18n)voidsetSocketType(FemaleGenericExpressionSocket.SocketType socketType)Set the type of the socket.-
Methods inherited from class jmri.jmrit.logixng.implementation.AbstractFemaleSocket
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, deepCopyChildren, dispose, forEntireTree, forEntireTreeWithException, getCategory, getChild, getChildCount, getComment, getConditionalNG, getDeepCopy, getEnableListeners, getListenerRef, getListenerRefs, getListenerRefsIncludingChildren, getLogixNG, getName, getNumPropertyChangeListeners, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getRoot, getSystemName, getUsageDetail, getUsageTree, getUserName, hasChild, isActive, printTree, printTree, printTree, printTreeRow, registerListeners, registerListenersForThisClass, removePropertyChangeListener, removePropertyChangeListener, setComment, setEnableListeners, setName, setParent, setParentForAllChildren, setUserName, unregisterListeners, unregisterListenersForThisClass, updateListenerRef, validateName, vetoableChange
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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, getModule, getNumPropertyChangeListeners, getParent, getPropertyChangeListenersByReference, getRoot, 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.jmrit.logixng.FemaleSocket
canDisconnect, doSocketOperation, getEnableListeners, getName, isAncestor, isSocketOperationAllowed, setEnableListeners, setName, setName, setup, validateName, validateName
-
Methods inherited from interface jmri.jmrit.logixng.FemaleSocketListener
socketNameChanged
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
DefaultFemaleGenericExpressionSocket
public DefaultFemaleGenericExpressionSocket(FemaleGenericExpressionSocket.SocketType socketType, Base parent, FemaleSocketListener listener, java.lang.String name)
-
-
Method Detail
-
getCurrentActiveSocket
public FemaleSocket getCurrentActiveSocket()
Get the current active socket.- Specified by:
getCurrentActiveSocketin interfaceFemaleGenericExpressionSocket- Returns:
- the currently active socket or null if no socket is active
-
isCompatible
public boolean isCompatible(MaleSocket socket)
Is a particular male socket compatible with this female socket?- Specified by:
isCompatiblein interfaceFemaleSocket- Parameters:
socket- the male socket- Returns:
- true if the male socket can be connected to this female socket
-
setSocketType
public void setSocketType(FemaleGenericExpressionSocket.SocketType socketType) throws SocketAlreadyConnectedException
Set the type of the socket.- Specified by:
setSocketTypein interfaceFemaleGenericExpressionSocket- Parameters:
socketType- the type of socket.- Throws:
SocketAlreadyConnectedException- if the socket is already connected and if the new type doesn't match the currently connected socket.
-
getSocketType
public FemaleGenericExpressionSocket.SocketType getSocketType()
Get the type of the socket.- Specified by:
getSocketTypein interfaceFemaleGenericExpressionSocket- Returns:
- the type of socket
-
setDoI18N
public void setDoI18N(boolean do_i18n)
-
getDoI18N
public boolean getDoI18N()
-
evaluateGeneric
@CheckForNull public java.lang.Object evaluateGeneric() throws JmriException
Description copied from interface:FemaleGenericExpressionSocketEvaluate this expression.This method validates the expression without doing any convertation of the return value.
The parameter isCompleted is used if the expression should be evaluated more than once. For example, the Count expression is not completed until its child expression has been true and false a number of times.
- Specified by:
evaluateGenericin interfaceFemaleGenericExpressionSocket- Returns:
- the result of the evaluation. This is of the same class as parentValue.
- Throws:
JmriException- when an exception occurs
-
getShortDescription
public java.lang.String getShortDescription(java.util.Locale locale)
Get a short description of this item.- Specified by:
getShortDescriptionin interfaceBase- Parameters:
locale- The locale to be used- Returns:
- a short description
-
getLongDescription
public java.lang.String getLongDescription(java.util.Locale locale)
Get a long description of this item.- Specified by:
getLongDescriptionin interfaceBase- Parameters:
locale- The locale to be used- Returns:
- a long description
-
getConnectableClasses
public java.util.Map<Category,java.util.List<java.lang.Class<? extends Base>>> getConnectableClasses()
Description copied from interface:FemaleSocketGet a set of classes that are compatible with this female socket.- Specified by:
getConnectableClassesin interfaceFemaleSocket- Returns:
- a set of entries with category and class
-
connect
public void connect(MaleSocket socket) throws SocketAlreadyConnectedException
Connect the male socket to this female socket.- Specified by:
connectin interfaceFemaleSocket- Overrides:
connectin classAbstractFemaleSocket- Parameters:
socket- the socket to connect- Throws:
SocketAlreadyConnectedException- if the socket is already connected
-
disconnect
public void disconnect()
Disconnect the current connected male socket from this female socket.- Specified by:
disconnectin interfaceFemaleSocket- Overrides:
disconnectin classAbstractFemaleSocket
-
getConnectedSocket
public MaleSocket getConnectedSocket()
Get the connected socket.- Specified by:
getConnectedSocketin interfaceFemaleSocket- Overrides:
getConnectedSocketin classAbstractFemaleSocket- Returns:
- the male socket or null if not connected
-
isConnected
public boolean isConnected()
Is a male socket connected to this female socket?- Specified by:
isConnectedin interfaceFemaleSocket- Overrides:
isConnectedin classAbstractFemaleSocket- Returns:
- true if connected
-
connected
public void connected(FemaleSocket socket)
Description copied from interface:FemaleSocketListenerThe socket is connected.- Specified by:
connectedin interfaceFemaleSocketListener- Parameters:
socket- the socket
-
disconnected
public void disconnected(FemaleSocket socket)
Description copied from interface:FemaleSocketListenerThe socket is disconnected.- Specified by:
disconnectedin interfaceFemaleSocketListener- Parameters:
socket- the socket
-
disposeMe
public void disposeMe()
- Specified by:
disposeMein classAbstractFemaleSocket
-
-