Package jmri.jmrit.logixng
Interface MaleSocket
-
- All Superinterfaces:
Base
,Debugable
,PropertyChangeProvider
- All Known Subinterfaces:
MaleAnalogActionSocket
,MaleAnalogExpressionSocket
,MaleDigitalActionSocket
,MaleDigitalBooleanActionSocket
,MaleDigitalExpressionSocket
,MaleStringActionSocket
,MaleStringExpressionSocket
- All Known Implementing Classes:
AbstractDebuggerMaleSocket
,AbstractMaleSocket
,DebuggerMaleAnalogActionSocket
,DebuggerMaleAnalogExpressionSocket
,DebuggerMaleDigitalActionSocket
,DebuggerMaleDigitalBooleanActionSocket
,DebuggerMaleDigitalExpressionSocket
,DebuggerMaleStringActionSocket
,DebuggerMaleStringExpressionSocket
,DefaultMaleAnalogActionSocket
,DefaultMaleAnalogExpressionSocket
,DefaultMaleDigitalActionSocket
,DefaultMaleDigitalBooleanActionSocket
,DefaultMaleDigitalExpressionSocket
,DefaultMaleStringActionSocket
,DefaultMaleStringExpressionSocket
,ModuleEditorMaleSocket
public interface MaleSocket extends Debugable
A LogixNG male socket.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
MaleSocket.ErrorHandlingType
-
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.Debugable
Debugable.DebugConfig
-
-
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 void
addLocalVariable(java.lang.String name, SymbolTable.InitialValueType initialValueType, java.lang.String initialValueData)
void
addLocalVariable(SymbolTable.VariableData variableData)
void
clearLocalVariables()
default MaleSocket
find(java.lang.Class<?> clazz)
Find a male socket of a particular type.boolean
getCatchAbortExecution()
Is the node catching AbortExecution or not?MaleSocket.ErrorHandlingType
getErrorHandlingType()
Get the error handling type for this socket.boolean
getListen()
Get whenether the node should listen to changes or not.java.util.List<SymbolTable.VariableData>
getLocalVariables()
BaseManager<? extends NamedBean>
getManager()
Get the manager that stores this socket.Base
getObject()
Get the object that this male socket holds.void
handleError(Base item, java.lang.String message, java.lang.RuntimeException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.void
handleError(Base item, java.lang.String message, java.util.List<java.lang.String> messageList, JmriException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.void
handleError(Base item, java.lang.String message, JmriException e, org.slf4j.Logger log)
Handle an error that has happened during execution or evaluation of this item.boolean
isEnabled()
Determines whether this male socket is enabled.boolean
isLocked()
Is the node locked?default boolean
isSupportingLocalVariables()
boolean
isSystem()
Is the node a system node?void
setCatchAbortExecution(boolean catchAbortExecution)
Set if the node should catch AbortExecution or not.void
setEnabled(boolean enable)
Set whenether this male socket is enabled or disabled.void
setEnabledFlag(boolean enable)
Set whenether this male socket is enabled or disabled, without activating the male socket.void
setErrorHandlingType(MaleSocket.ErrorHandlingType errorHandlingType)
Set the error handling type for this socket.void
setListen(boolean listen)
Set whenether the node should listen to changes or not.void
setLocked(boolean locked)
Set if the node is locked or not.void
setSystem(boolean system)
Set if the node is system or not.default void
setup()
Setup this object and its children.-
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, isSocketOperationAllowed, printTree, printTree, printTree, printTree, printTree, registerListeners, setComment, setParent, setParentForAllChildren, setUserName, unregisterListeners, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.jmrit.logixng.Debugable
createDebugConfig, getDebugConfig, setDebugConfig
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Method Detail
-
setEnabled
void setEnabled(boolean enable)
Set whenether this male socket is enabled or disabled.This method must call registerListeners() / unregisterListeners().
- Parameters:
enable
- true if this male socket should be enabled, false otherwise
-
setEnabledFlag
void setEnabledFlag(boolean enable)
Set whenether this male socket is enabled or disabled, without activating the male socket. This is used when loading the xml file and when copying an item.This method must call registerListeners() / unregisterListeners().
- Parameters:
enable
- true if this male socket should be enabled, false otherwise
-
isEnabled
boolean isEnabled()
Determines whether this male socket is enabled.
-
getListen
boolean getListen()
Get whenether the node should listen to changes or not.- Returns:
- true if listen, false if not listen
-
setListen
void setListen(boolean listen)
Set whenether the node should listen to changes or not.- Parameters:
listen
- true if listen, false if not listen
-
isLocked
boolean isLocked()
Is the node locked?- Returns:
- true if locked, false otherwise
-
setLocked
void setLocked(boolean locked)
Set if the node is locked or not.- Parameters:
locked
- true if locked, false otherwise
-
isSystem
boolean isSystem()
Is the node a system node?- Returns:
- true if system, false otherwise
-
setSystem
void setSystem(boolean system)
Set if the node is system or not.- Parameters:
system
- true if system, false otherwise
-
getCatchAbortExecution
boolean getCatchAbortExecution()
Is the node catching AbortExecution or not?- Returns:
- true if catching, false otherwise
-
setCatchAbortExecution
void setCatchAbortExecution(boolean catchAbortExecution)
Set if the node should catch AbortExecution or not.- Parameters:
catchAbortExecution
- true if catch, false otherwise
-
addLocalVariable
void addLocalVariable(java.lang.String name, SymbolTable.InitialValueType initialValueType, java.lang.String initialValueData)
-
addLocalVariable
void addLocalVariable(SymbolTable.VariableData variableData)
-
clearLocalVariables
void clearLocalVariables()
-
getLocalVariables
java.util.List<SymbolTable.VariableData> getLocalVariables()
-
isSupportingLocalVariables
default boolean isSupportingLocalVariables()
-
getErrorHandlingType
MaleSocket.ErrorHandlingType getErrorHandlingType()
Get the error handling type for this socket.- Returns:
- the error handling type
-
setErrorHandlingType
void setErrorHandlingType(MaleSocket.ErrorHandlingType errorHandlingType)
Set the error handling type for this socket.- Parameters:
errorHandlingType
- the error handling type
-
handleError
void handleError(Base item, java.lang.String message, JmriException e, org.slf4j.Logger log) throws JmriException
Handle an error that has happened during execution or evaluation of this item.- Parameters:
item
- the item that had the errormessage
- the error messagee
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
handleError
void handleError(Base item, java.lang.String message, java.util.List<java.lang.String> messageList, JmriException e, org.slf4j.Logger log) throws JmriException
Handle an error that has happened during execution or evaluation of this item.- Parameters:
item
- the item that had the errormessage
- the error messagemessageList
- a list of error messagese
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
handleError
void handleError(Base item, java.lang.String message, java.lang.RuntimeException e, org.slf4j.Logger log) throws JmriException
Handle an error that has happened during execution or evaluation of this item.- Parameters:
item
- the item that had the errormessage
- the error messagee
- the exception that has happenedlog
- the logger- Throws:
JmriException
- if the male socket is configured to throw an exception
-
getObject
@Nonnull Base getObject()
Get the object that this male socket holds. This method is used when the object is going to be configured.- Returns:
- the object this male socket holds
-
getManager
BaseManager<? extends NamedBean> getManager()
Get the manager that stores this socket. This method is used when the object is going to be configured.- Returns:
- the manager
-
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.
-
find
default MaleSocket find(java.lang.Class<?> clazz)
Find a male socket of a particular type. Male sockets can be stacked and this method travels thru the stacked male sockets to find the desired male socket.- Parameters:
clazz
- the type of the male socket we are looking for- Returns:
- the found male socket or null if not found
-
-