Package nl.rrd.wool.expressions.types
Class AssignExpression
- java.lang.Object
-
- nl.rrd.wool.expressions.types.AssignExpression
-
- All Implemented Interfaces:
Expression
public class AssignExpression extends Object implements Expression
-
-
Constructor Summary
Constructors Constructor Description AssignExpression(Expression variableOperand, Token operator, Expression valueOperand)
-
Method Summary
Modifier and Type Method Description Valueevaluate(Map<String,Object> variables)Evaluates this expression using the specified variable values.List<Expression>getChildren()Returns the child expressions of this expression.List<Expression>getDescendants()Returns all descendant expressions of this expression.ExpressiongetValueOperand()StringgetVariableName()Set<String>getVariableNames()Returns all variable names that occur in this expression and its descendants.ExpressiongetVariableOperand()StringtoString()
-
-
-
Constructor Detail
-
AssignExpression
public AssignExpression(Expression variableOperand, Token operator, Expression valueOperand) throws LineNumberParseException
- Throws:
LineNumberParseException
-
-
Method Detail
-
getVariableOperand
public Expression getVariableOperand()
-
getVariableName
public String getVariableName()
-
getValueOperand
public Expression getValueOperand()
-
evaluate
public Value evaluate(Map<String,Object> variables) throws EvaluationException
Description copied from interface:ExpressionEvaluates this expression using the specified variable values. The variable map may be modified as a result of an "assign" expression.- Specified by:
evaluatein interfaceExpression- Parameters:
variables- the variable values (can be null)- Returns:
- the value of the expression
- Throws:
EvaluationException- if the expression can't be evaluted with the specified variables
-
getChildren
public List<Expression> getChildren()
Description copied from interface:ExpressionReturns the child expressions of this expression.- Specified by:
getChildrenin interfaceExpression- Returns:
- the child expressions
-
getDescendants
public List<Expression> getDescendants()
Description copied from interface:ExpressionReturns all descendant expressions of this expression.- Specified by:
getDescendantsin interfaceExpression- Returns:
- the descendant expressions
-
getVariableNames
public Set<String> getVariableNames()
Description copied from interface:ExpressionReturns all variable names that occur in this expression and its descendants.- Specified by:
getVariableNamesin interfaceExpression- Returns:
- the variable names
-
-