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:
java.lang.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.RunnableWithBaseThrowException
-
Nested 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
_listenersAreRegistered
-
Fields inherited from class jmri.implementation.AbstractNamedBean
listenerRefs, mSystemName, register
-
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
-
Fields inherited from interface jmri.jmrit.logixng.DigitalExpressionBean
FALSE, TRUE
-
Fields inherited from interface jmri.NamedBean
DISPLAY_NAME_FORMAT, INCONSISTENT, PROPERTY_STATE, QUOTED_NAME_FORMAT, UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description AbstractDigitalExpression(java.lang.String sys, java.lang.String user)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
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.java.lang.String
getNewSocketName()
static java.lang.String
getNewSocketName(java.lang.String[] names)
Base
getParent()
Get the parent.int
getState()
Provide generic access to internal state.void
notifyChangedResult(boolean oldResult, boolean newResult)
Notify property change listeners that the result of the expression has changed.void
setParent(Base parent)
Set the parent.void
setState(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, unregisterListenersForThisClass
-
Methods 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, vetoableChange
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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, 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, vetoableChange
-
Methods inherited from interface jmri.jmrit.logixng.DigitalExpression
evaluate
-
Methods inherited from interface jmri.NamedBean
addPropertyChangeListener, addPropertyChangeListener, compareSystemNameSuffix, compareTo, describeState, dispose, getComment, getDisplayName, getDisplayName, getListenerRef, getListenerRefs, getNumPropertyChangeListeners, getProperty, getPropertyChangeListenersByReference, getPropertyKeys, getSystemName, getUsageReport, getUserName, removeProperty, setComment, setProperty, setUserName, toString, updateListenerRef, vetoableChange
-
Methods inherited from interface jmri.beans.PropertyChangeProvider
addPropertyChangeListener, addPropertyChangeListener, getPropertyChangeListeners, getPropertyChangeListeners, removePropertyChangeListener, removePropertyChangeListener
-
-
-
-
Constructor Detail
-
AbstractDigitalExpression
public AbstractDigitalExpression(java.lang.String sys, java.lang.String user) throws NamedBean.BadUserNameException, NamedBean.BadSystemNameException
-
-
Method Detail
-
notifyChangedResult
public void notifyChangedResult(boolean oldResult, boolean newResult)
Notify property change listeners that the result of the expression has changed.- Specified by:
notifyChangedResult
in interfaceDigitalExpressionBean
- Parameters:
oldResult
- the old last resultnewResult
- the new last result
-
getParent
public Base 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
public void setParent(Base parent)
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
public java.lang.String 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:
getBeanType
in interfaceNamedBean
- Returns:
- a string of the bean type, eg Turnout, Sensor etc
-
setState
public void setState(int s) throws JmriException
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:
setState
in interfaceNamedBean
- Parameters:
s
- the state- Throws:
JmriException
- general error when setting the state fails
-
getState
public int 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
public java.lang.String getNewSocketName()
-
getNewSocketName
public static java.lang.String getNewSocketName(java.lang.String[] names)
-
-