Package jmri.jmrit.logixng.expressions
Class AbstractDigitalExpression
java.lang.Object
jmri.implementation.AbstractNamedBean
jmri.jmrit.logixng.implementation.AbstractBase
jmri.jmrit.logixng.expressions.AbstractDigitalExpression
- All Implemented Interfaces:
Comparable<NamedBean>,PropertyChangeProvider,Base,DigitalExpression,DigitalExpressionBean,NamedBean
- Direct Known Subclasses:
And,Antecedent,ConnectionName,DigitalCallModule,DigitalFormula,ExpressionAudio,ExpressionBlock,ExpressionClock,ExpressionConditional,ExpressionDispatcher,ExpressionEntryExit,ExpressionLight,ExpressionLinuxLinePower,ExpressionLocalVariable,ExpressionMemory,ExpressionOBlock,ExpressionPower,ExpressionReference,ExpressionReporter,ExpressionScript,ExpressionSection,ExpressionSensor,ExpressionSensorEdge,ExpressionSignalHead,ExpressionSignalMast,ExpressionSlotUsage,ExpressionTransit,ExpressionTurnout,ExpressionWarrant,False,FileAsFlag,Hold,LastResultOfDigitalExpression,LogData,Not,Or,Timer,TriggerOnce,True
public abstract class AbstractDigitalExpression
extends AbstractBase
implements DigitalExpressionBean
-
Nested Class Summary
Nested classes/interfaces inherited from interface jmri.jmrit.logixng.Base
Base.PrintTreeSettings, Base.RunnableWithBase, Base.RunnableWithBaseThrowExceptionNested classes/interfaces inherited from interface jmri.NamedBean
NamedBean.BadNameException, NamedBean.BadSystemNameException, NamedBean.BadUserNameException, NamedBean.DisplayOptions, NamedBean.DuplicateSystemNameException -
Field Summary
Fields inherited from class jmri.jmrit.logixng.implementation.AbstractBase
_listenersAreRegisteredFields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, registerFields 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_DISCONNECTEDFields inherited from interface jmri.jmrit.logixng.DigitalExpressionBean
FALSE, TRUEFields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_COMMENT, PROPERTY_ENABLED, PROPERTY_KNOWN_STATE, PROPERTY_STATE, PROPERTY_USERNAME, QUOTED_NAME_FORMAT, UNKNOWN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFor instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.static StringgetNewSocketName(String[] names) Get the parent.intgetState()Provide generic access to internal state.voidnotifyChangedResult(boolean oldResult, boolean newResult) Notify property change listeners that the result of the expression has changed.voidSet the parent.voidsetState(int s) Provide generic access to internal state.Methods inherited from class jmri.jmrit.logixng.implementation.AbstractBase
assertListenersAreNotRegistered, compareSystemNameSuffix, deepCopyChildren, dispose, disposeMe, getCategory, getChild, getChildCount, getConditionalNG, getListenerRefsIncludingChildren, getLogixNG, getRoot, getUsageDetail, getUsageTree, isActive, printTree, printTree, printTree, printTreeRow, registerListeners, registerListenersForThisClass, setParentForAllChildren, unregisterListeners, unregisterListenersForThisClassMethods inherited from class jmri.implementation.AbstractNamedBean
addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, addPropertyChangeListener, describeState, equals, firePropertyChange, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListeners, getPropertyChangeListeners, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUserName, hashCode, removeProperty, removePropertyChangeListener, removePropertyChangeListener, setComment, setProperty, setUserName, toString, toStringSuffix, updateListenerRef, vetoableChangeMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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, getPropertyChangeListenersByReference, getRoot, getShortDescription, getShortDescription, getSystemName, getUsageDetail, getUsageTree, getUserName, hasChild, isActive, isEnabled, isSocketOperationAllowed, printTree, printTree, printTree, printTree, printTree, registerListeners, setComment, setParentForAllChildren, setup, setUserName, unregisterListeners, updateListenerRef, vetoableChangeMethods inherited from interface jmri.jmrit.logixng.DigitalExpression
evaluateMethods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getRecommendedToolTip, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChangeMethods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
AbstractDigitalExpression
public AbstractDigitalExpression(String sys, String user) throws NamedBean.BadUserNameException, NamedBean.BadSystemNameException
-
-
Method Details
-
notifyChangedResult
Notify property change listeners that the result of the expression has changed.- Specified by:
notifyChangedResultin interfaceDigitalExpressionBean- Parameters:
oldResult- the old last resultnewResult- the new last result
-
getParent
Get the parent.The following rules apply
- LogixNGs has no parent. The method throws an UnsupportedOperationException if called.
- Expressions and actions has the male socket that they are connected to as their parent.
- Male sockets has the female socket that they are connected to as their parent.
- The parent of a female sockets is the LogixNG, expression or action that has this female socket.
- The parent of a male sockets is the same parent as the expression or action that it contains.
-
setParent
Set the parent.The following rules apply
- ExecutionGroups has no parent. The method throws an UnsupportedOperationException if called.
- LogixNGs has the execution group as its parent.
- Expressions and actions has the male socket that they are connected to as their parent.
- Male sockets has the female socket that they are connected to as their parent.
- The parent of a female sockets is the LogixNG, expression or action that has this female socket.
- The parent of a male sockets is the same parent as the expression or action that it contains.
-
getBeanType
For instances in the code where we are dealing with just a bean and a message needs to be passed to the user or in a log.- Specified by:
getBeanTypein interfaceNamedBean- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
setState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. setCommandedState in Turnout). This is provided to make scripts access easier to read.
- Specified by:
setStatein interfaceNamedBean- Parameters:
s- the state- Throws:
JmriException- general error when setting the state fails
-
getState
Provide generic access to internal state.This generally shouldn't be used by Java code; use the class-specific form instead (e.g. getCommandedState in Turnout). This is provided to make scripts easier to read.
-
getNewSocketName
-
getNewSocketName
-