Venice 0.751beta

nz.org.venice.parser.expression
Class HaltExpression

java.lang.Object
  extended bynz.org.venice.parser.expression.AbstractExpression
      extended bynz.org.venice.parser.expression.UnaryExpression
          extended bynz.org.venice.parser.expression.AlertExpression
              extended bynz.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

Field Summary
 
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
 
Constructor Summary
HaltExpression(Expression arg, Expression[] optionalArgs)
          Create a new alert expression.
 
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.AlertExpression
checkType, getChild, getChildCount, getType, toString
 
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
 

Constructor Detail

HaltExpression

public HaltExpression(Expression arg,
                      Expression[] optionalArgs)
Create a new alert expression.

Parameters:
arg - The message expression
optionalArgs - Optional expressions (max 4) which are appended to the message defined in arg.
Method Detail

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 rule
quoteBundle - The quote bundle containing the symbol data
symbol - The implicit symbol of the rule
day - 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.

Venice 0.751beta