Package jmri.jmrit.logixng.util.parser
Class ExpressionNodeInstanceVariable
- java.lang.Object
-
- jmri.jmrit.logixng.util.parser.ExpressionNodeInstanceVariable
-
- All Implemented Interfaces:
ExpressionNode
,ExpressionNodeWithParameter
public class ExpressionNodeInstanceVariable extends java.lang.Object implements ExpressionNodeWithParameter
A parsed expression
-
-
Constructor Summary
Constructors Constructor Description ExpressionNodeInstanceVariable(java.lang.String fieldName, java.util.Map<java.lang.String,Variable> variables)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
assignValue(java.lang.Object parameter, SymbolTable symbolTable, java.lang.Object value)
Assign a value to this expression from a parameter.java.lang.Object
calculate(java.lang.Object parameter, SymbolTable symbolTable)
Calculate the expression from a parameter.boolean
canBeAssigned()
Can this expression be assigned a value?java.lang.String
getDefinitionString()
Get a String that defines this expression node.-
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.util.parser.ExpressionNode
assignValue
-
Methods inherited from interface jmri.jmrit.logixng.util.parser.ExpressionNodeWithParameter
calculate
-
-
-
-
Constructor Detail
-
ExpressionNodeInstanceVariable
public ExpressionNodeInstanceVariable(java.lang.String fieldName, java.util.Map<java.lang.String,Variable> variables) throws IdentifierNotExistsException
- Throws:
IdentifierNotExistsException
-
-
Method Detail
-
calculate
public java.lang.Object calculate(java.lang.Object parameter, SymbolTable symbolTable) throws JmriException
Description copied from interface:ExpressionNodeWithParameter
Calculate the expression from a parameter.- Specified by:
calculate
in interfaceExpressionNodeWithParameter
- Parameters:
parameter
- the parametersymbolTable
- the symbol table- Returns:
- the result
- Throws:
JmriException
- if an error occurs
-
canBeAssigned
public boolean canBeAssigned()
Can this expression be assigned a value?- Specified by:
canBeAssigned
in interfaceExpressionNode
- Returns:
- true if it's possible to assign a value to this expression, false otherwise
-
assignValue
public void assignValue(java.lang.Object parameter, SymbolTable symbolTable, java.lang.Object value) throws JmriException
Assign a value to this expression from a parameter.- Specified by:
assignValue
in interfaceExpressionNodeWithParameter
- Parameters:
parameter
- the parametersymbolTable
- the symbol tablevalue
- the value to assign- Throws:
JmriException
- if an error occurs
-
getDefinitionString
public java.lang.String getDefinitionString()
Get a String that defines this expression node.- Specified by:
getDefinitionString
in interfaceExpressionNode
- Returns:
- the string
-
-