nz.org.venice.parser.expression
Class HaltExpression
java.lang.Object
nz.org.venice.parser.expression.AbstractExpression
nz.org.venice.parser.expression.UnaryExpression
nz.org.venice.parser.expression.AlertExpression
nz.org.venice.parser.expression.HaltExpression
- All Implemented Interfaces:
- java.lang.Cloneable, Expression
- public class HaltExpression
- extends AlertExpression
An no op expression which when evaluated halts the processing of rules.
Use for when something seriously wrong happens and you don't care about
the rest of the days results.
Will first display the alert message defined by the arguments.
- Author:
- Mark Hummel
| Fields inherited from interface nz.org.venice.parser.Expression |
BOOLEAN_TYPE, FALSE, FLOAT_QUOTE_TYPE, FLOAT_TYPE, INTEGER_QUOTE_TYPE, INTEGER_SHORT_TYPE, INTEGER_TYPE, NUMERIC_TYPE, STRING_TYPE, TRUE, TRUE_LEVEL, UNDEFINED_TYPE |
|
Method Summary |
java.lang.Object |
clone()
|
double |
evaluate(Variables variables,
QuoteBundle quoteBundle,
Symbol symbol,
int day)
Evaluate the expression and subexpressions, and then display the
resulting message. |
| Methods inherited from class nz.org.venice.parser.expression.AbstractExpression |
equals, getId, getIndex, getNumberFormat, getParent, getParseMetadata, hashCode, isRoot, iterator, parseDouble, parseInt, printParents, setChild, setChildMutableVersion, setParent, setParseMetadata, simplify, simplifyMutableVersion, size, size, validTree, valueOfDouble, valueOfInt |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
HaltExpression
public HaltExpression(Expression arg,
Expression[] optionalArgs)
- Create a new alert expression.
- Parameters:
arg - The message expressionoptionalArgs - Optional expressions (max 4) which are appended to
the message defined in arg.
evaluate
public double evaluate(Variables variables,
QuoteBundle quoteBundle,
Symbol symbol,
int day)
throws EvaluationException
- Evaluate the expression and subexpressions, and then display the
resulting message.
- Specified by:
evaluate in interface Expression- Overrides:
evaluate in class AlertExpression
- Parameters:
variables - The variables of the rulequoteBundle - The quote bundle containing the symbol datasymbol - The implicit symbol of the ruleday - The date offset used to evaluate the rule.
- Returns:
- 0.0
- Throws:
EvaluationException
clone
public java.lang.Object clone()
- Specified by:
clone in interface Expression- Overrides:
clone in class AlertExpression
- Returns:
- A clone of the object.