Venice 0.751beta

nz.org.venice.parser
Class EvaluationException

java.lang.Object
  extended byjava.lang.Throwable
      extended bynz.org.venice.parser.ExpressionException
          extended bynz.org.venice.parser.EvaluationException
All Implemented Interfaces:
java.io.Serializable

public class EvaluationException
extends ExpressionException

An exception which is thrown when there is a problem executing an expression. Since this exception can be thrown a lot by the GP, and a stack trace is not used, common compile time exceptions have been made static to avoid generating unused stack traces. See Java Performance Tuning for more information.

Author:
Andrew Leppard
See Also:
Serialized Form

Field Summary
static EvaluationException AVG_OFFSET_EXCEPTION
          An exception which is thrown on an invalid avg() offset.
static EvaluationException AVG_RANGE_EXCEPTION
          An exception which is thrown on an invalid avg() range.
static EvaluationException BBL_OFFSET_EXCEPTION
          An exception which is thrown on an invalid bol_upper() offset.
static EvaluationException BBL_RANGE_EXCEPTION
          An exception which is thrown on an invalid bol_lower() range.
static EvaluationException BBU_OFFSET_EXCEPTION
          An exception which is thrown on an invalid bbu() offset.
static EvaluationException BBU_RANGE_EXCEPTION
          An exception which is thrown on an invalid bol_upper() range.
static EvaluationException CORR_OFFSET_EXCEPTION
          An exception which is thrown on an invalid corr() offset.
static EvaluationException CORR_RANGE_EXCEPTION
          An exception which is thrown on an invalid corr() range.
static EvaluationException DIVIDE_BY_ZERO_EXCEPTION
          An exception which is thrown when per performa a divide by zero operation.
static EvaluationException EMA_OFFSET_EXCEPTION
          An exception which is thrown on an invalid ema() offset.
static EvaluationException EMA_RANGE_EXCEPTION
          An exception which is thrown on an invalid ema() range.
static EvaluationException EMA_SMOOTHING_EXCEPTION
          An exception which is thrown on an invalid ema() smoothing constant.
static EvaluationException EVAL_TIME_TOO_LONG_EXCEPTION
          An exception which is thrown when the result of a calculation for a day/symbol exceeds the time limit.
static EvaluationException EVALUATION_HALTED_EXCEPTION
          An exception which is thrown when a HaltExpression is evaluated.
static EvaluationException FUTURE_DATE_EXCEPTION
          An exception which is thrown when the GP tries to access a date that is too far into the future.
static EvaluationException LAG_OFFSET_EXCEPTION
          An exception which is thrown on an invalid lag() offset.
static EvaluationException LOGARITHM_NEGATIVE_EXCEPTION
          An exception which is thrown when trying to calculate the logarithm of a negative number.
static EvaluationException MACD_OFFSET_EXCEPTION
          An exception which is thrown on an invalid macd() offset.
static EvaluationException MAX_OFFSET_EXCEPTION
          An exception which is thrown on an invalid max() offset.
static EvaluationException MAX_RANGE_EXCEPTION
          An exception which is thrown on an invalid max() range.
static EvaluationException MIN_OFFSET_EXCEPTION
          An exception which is thrown on an invalid min() offset.
static EvaluationException MIN_RANGE_EXCEPTION
          An exception which is thrown on an invalid min() range.
static EvaluationException MOMENTUM_OFFSET_EXCEPTION
          An exception which is thrown on an invalid momentum() offset.
static EvaluationException MOMENTUM_RANGE_EXCEPTION
          An exception which is thrown on an invalid momentum() range.
static EvaluationException OBV_OFFSET_EXCEPTION
          An exception which is thrown on an invalid obv() offset.
static EvaluationException OBV_RANGE_EXCEPTION
          An exception which is thrown on an invalid obv() range.
static EvaluationException PAST_DATE_EXCEPTION
          An exception which is thrown when the GP tries to access a date that is too distant in the past.
static EvaluationException RSI_OFFSET_EXCEPTION
          An exception which is thrown on an invalid rsi() offset.
static EvaluationException RSI_RANGE_EXCEPTION
          An exception which is thrown on an invalid rsi() range.
static EvaluationException SD_OFFSET_EXCEPTION
          An exception which is thrown on an invalid sd() offset.
static EvaluationException SD_RANGE_EXCEPTION
          An exception which is thrown on an invalid sd() range.
static EvaluationException SQUARE_ROOT_NEGATIVE_EXCEPTION
          An exception which is thrown when trying to calculate the square root of a negative number.
static EvaluationException STACK_DEPTH_EXCEEDED_EXCEPTION
          An exception which is thrown when the function call depth exceeds the limit. e.g. possibly due to infinite recursion
static EvaluationException SUM_OFFSET_EXCEPTION
          An exception which is thrown on an invalid sum() offset.
static EvaluationException SUM_RANGE_EXCEPTION
          An exception which is thrown on an invalid sum() range.
static EvaluationException UNDEFINED_RESULT_EXCEPTION
          An exception which is thrown when the result of a calculation is undefined. e.g.
 
Constructor Summary
EvaluationException(java.lang.String reason)
          Create a new evaluation exception with the given error reason.
 
Method Summary
 java.lang.String getReason()
          Return the reason this exception was raised.
 void setMessage(Expression e, java.lang.String label, double value)
           
 
Methods inherited from class nz.org.venice.parser.ExpressionException
toString
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DIVIDE_BY_ZERO_EXCEPTION

public static EvaluationException DIVIDE_BY_ZERO_EXCEPTION
An exception which is thrown when per performa a divide by zero operation.


FUTURE_DATE_EXCEPTION

public static EvaluationException FUTURE_DATE_EXCEPTION
An exception which is thrown when the GP tries to access a date that is too far into the future.


PAST_DATE_EXCEPTION

public static EvaluationException PAST_DATE_EXCEPTION
An exception which is thrown when the GP tries to access a date that is too distant in the past.


AVG_RANGE_EXCEPTION

public static EvaluationException AVG_RANGE_EXCEPTION
An exception which is thrown on an invalid avg() range.


BBL_RANGE_EXCEPTION

public static EvaluationException BBL_RANGE_EXCEPTION
An exception which is thrown on an invalid bol_lower() range.


BBU_RANGE_EXCEPTION

public static EvaluationException BBU_RANGE_EXCEPTION
An exception which is thrown on an invalid bol_upper() range.


CORR_RANGE_EXCEPTION

public static EvaluationException CORR_RANGE_EXCEPTION
An exception which is thrown on an invalid corr() range.


EMA_RANGE_EXCEPTION

public static EvaluationException EMA_RANGE_EXCEPTION
An exception which is thrown on an invalid ema() range.


MAX_RANGE_EXCEPTION

public static EvaluationException MAX_RANGE_EXCEPTION
An exception which is thrown on an invalid max() range.


MIN_RANGE_EXCEPTION

public static EvaluationException MIN_RANGE_EXCEPTION
An exception which is thrown on an invalid min() range.


MOMENTUM_RANGE_EXCEPTION

public static EvaluationException MOMENTUM_RANGE_EXCEPTION
An exception which is thrown on an invalid momentum() range.


OBV_RANGE_EXCEPTION

public static EvaluationException OBV_RANGE_EXCEPTION
An exception which is thrown on an invalid obv() range.


RSI_RANGE_EXCEPTION

public static EvaluationException RSI_RANGE_EXCEPTION
An exception which is thrown on an invalid rsi() range.


SD_RANGE_EXCEPTION

public static EvaluationException SD_RANGE_EXCEPTION
An exception which is thrown on an invalid sd() range.


SUM_RANGE_EXCEPTION

public static EvaluationException SUM_RANGE_EXCEPTION
An exception which is thrown on an invalid sum() range.


AVG_OFFSET_EXCEPTION

public static EvaluationException AVG_OFFSET_EXCEPTION
An exception which is thrown on an invalid avg() offset.


BBL_OFFSET_EXCEPTION

public static EvaluationException BBL_OFFSET_EXCEPTION
An exception which is thrown on an invalid bol_upper() offset.


BBU_OFFSET_EXCEPTION

public static EvaluationException BBU_OFFSET_EXCEPTION
An exception which is thrown on an invalid bbu() offset.


CORR_OFFSET_EXCEPTION

public static EvaluationException CORR_OFFSET_EXCEPTION
An exception which is thrown on an invalid corr() offset.


EMA_OFFSET_EXCEPTION

public static EvaluationException EMA_OFFSET_EXCEPTION
An exception which is thrown on an invalid ema() offset.


LAG_OFFSET_EXCEPTION

public static EvaluationException LAG_OFFSET_EXCEPTION
An exception which is thrown on an invalid lag() offset.


MACD_OFFSET_EXCEPTION

public static EvaluationException MACD_OFFSET_EXCEPTION
An exception which is thrown on an invalid macd() offset.


MAX_OFFSET_EXCEPTION

public static EvaluationException MAX_OFFSET_EXCEPTION
An exception which is thrown on an invalid max() offset.


MIN_OFFSET_EXCEPTION

public static EvaluationException MIN_OFFSET_EXCEPTION
An exception which is thrown on an invalid min() offset.


MOMENTUM_OFFSET_EXCEPTION

public static EvaluationException MOMENTUM_OFFSET_EXCEPTION
An exception which is thrown on an invalid momentum() offset.


OBV_OFFSET_EXCEPTION

public static EvaluationException OBV_OFFSET_EXCEPTION
An exception which is thrown on an invalid obv() offset.


RSI_OFFSET_EXCEPTION

public static EvaluationException RSI_OFFSET_EXCEPTION
An exception which is thrown on an invalid rsi() offset.


SD_OFFSET_EXCEPTION

public static EvaluationException SD_OFFSET_EXCEPTION
An exception which is thrown on an invalid sd() offset.


SUM_OFFSET_EXCEPTION

public static EvaluationException SUM_OFFSET_EXCEPTION
An exception which is thrown on an invalid sum() offset.


EMA_SMOOTHING_EXCEPTION

public static EvaluationException EMA_SMOOTHING_EXCEPTION
An exception which is thrown on an invalid ema() smoothing constant.


SQUARE_ROOT_NEGATIVE_EXCEPTION

public static EvaluationException SQUARE_ROOT_NEGATIVE_EXCEPTION
An exception which is thrown when trying to calculate the square root of a negative number.


LOGARITHM_NEGATIVE_EXCEPTION

public static EvaluationException LOGARITHM_NEGATIVE_EXCEPTION
An exception which is thrown when trying to calculate the logarithm of a negative number.


UNDEFINED_RESULT_EXCEPTION

public static EvaluationException UNDEFINED_RESULT_EXCEPTION
An exception which is thrown when the result of a calculation is undefined. e.g. Calculating the average of the empty set


EVAL_TIME_TOO_LONG_EXCEPTION

public static EvaluationException EVAL_TIME_TOO_LONG_EXCEPTION
An exception which is thrown when the result of a calculation for a day/symbol exceeds the time limit.


STACK_DEPTH_EXCEEDED_EXCEPTION

public static EvaluationException STACK_DEPTH_EXCEEDED_EXCEPTION
An exception which is thrown when the function call depth exceeds the limit. e.g. possibly due to infinite recursion


EVALUATION_HALTED_EXCEPTION

public static EvaluationException EVALUATION_HALTED_EXCEPTION
An exception which is thrown when a HaltExpression is evaluated.

Constructor Detail

EvaluationException

public EvaluationException(java.lang.String reason)
Create a new evaluation exception with the given error reason. Make any exception without a run-time error message static so the GP doesn't waste time building stack traces.

Parameters:
reason - the reason the execution failed
Method Detail

setMessage

public void setMessage(Expression e,
                       java.lang.String label,
                       double value)

getReason

public java.lang.String getReason()
Description copied from class: ExpressionException
Return the reason this exception was raised.

Overrides:
getReason in class ExpressionException
Returns:
the reason the exception was raised

Venice 0.751beta