org.datanucleus.query.evaluator
Class AbstractExpressionEvaluator

java.lang.Object
  extended by org.datanucleus.query.evaluator.AbstractExpressionEvaluator
All Implemented Interfaces:
ExpressionEvaluator
Direct Known Subclasses:
InMemoryExpressionEvaluator

public class AbstractExpressionEvaluator
extends java.lang.Object
implements ExpressionEvaluator

Abstract evaluator for an expression. Provides a stack-like process, working its way through the expression tree. Provides methods processXXX that should be implemented by the subclass where it supports the particular operator or expression.


Constructor Summary
AbstractExpressionEvaluator()
           
 
Method Summary
protected  java.lang.Object compileAdditiveExpression(Expression expr)
           
protected  java.lang.Object compileAndExpression(Expression expr)
          This method deals with the AND condition A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown
protected  java.lang.Object compileEqualityExpression(Expression expr)
           
protected  java.lang.Object compileMultiplicativeExpression(Expression expr)
           
protected  java.lang.Object compileOrExpression(Expression expr)
          This method deals with the AND condition A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown
protected  java.lang.Object compilePrimaryExpression(Expression expr)
           
protected  java.lang.Object compileRelationalExpression(Expression expr)
           
protected  java.lang.Object compileUnaryExpression(Expression expr)
           
protected  java.lang.Object compileUnaryExpressionNotPlusMinus(Expression expr)
           
 java.lang.Object evaluate(Expression expr)
          Method to "evaluate" the expression.
protected  java.lang.Object processAddExpression(Expression expr)
          Method to process the supplied ADD expression.
protected  java.lang.Object processAndExpression(Expression expr)
          Method to process the supplied AND expression.
protected  java.lang.Object processComExpression(Expression expr)
          Method to process the supplied COM expression.
protected  java.lang.Object processCreatorExpression(CreatorExpression expr)
          Method to process the supplied creator expression.
protected  java.lang.Object processDivExpression(Expression expr)
          Method to process the supplied DIV expression.
protected  java.lang.Object processEqExpression(Expression expr)
          Method to process the supplied EQ expression.
protected  java.lang.Object processGteqExpression(Expression expr)
          Method to process the supplied GTEQ expression.
protected  java.lang.Object processGtExpression(Expression expr)
          Method to process the supplied GT expression.
protected  java.lang.Object processInvokeExpression(InvokeExpression expr)
          Method to process the supplied invoke expression.
protected  java.lang.Object processIsExpression(Expression expr)
          Method to process the supplied IS (instanceof) expression.
protected  java.lang.Object processLikeExpression(Expression expr)
          Method to process the supplied LIKE expression.
protected  java.lang.Object processLiteral(Literal expr)
          Method to process the supplied invoke expression.
protected  java.lang.Object processLteqExpression(Expression expr)
          Method to process the supplied LTEQ expression.
protected  java.lang.Object processLtExpression(Expression expr)
          Method to process the supplied LT expression.
protected  java.lang.Object processModExpression(Expression expr)
          Method to process the supplied MOD expression.
protected  java.lang.Object processMulExpression(Expression expr)
          Method to process the supplied MUL expression.
protected  java.lang.Object processNegExpression(Expression expr)
          Method to process the supplied NEG expression.
protected  java.lang.Object processNoteqExpression(Expression expr)
          Method to process the supplied NOTEQ expression.
protected  java.lang.Object processNotExpression(Expression expr)
          Method to process the supplied NOT expression.
protected  java.lang.Object processOrExpression(Expression expr)
          Method to process the supplied OR expression.
protected  java.lang.Object processParameterExpression(ParameterExpression expr)
          Method to process the supplied parameter expression.
protected  java.lang.Object processPrimaryExpression(PrimaryExpression expr)
          Method to process the supplied primary expression.
protected  java.lang.Object processSubExpression(Expression expr)
          Method to process the supplied SUB expression.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractExpressionEvaluator

public AbstractExpressionEvaluator()
Method Detail

evaluate

public java.lang.Object evaluate(Expression expr)
Method to "evaluate" the expression.

Specified by:
evaluate in interface ExpressionEvaluator

compileOrExpression

protected java.lang.Object compileOrExpression(Expression expr)
This method deals with the AND condition A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown


compileAndExpression

protected java.lang.Object compileAndExpression(Expression expr)
This method deals with the AND condition A condition specifies a combination of one or more expressions and logical (Boolean) operators and returns a value of TRUE, FALSE, or unknown


compileEqualityExpression

protected java.lang.Object compileEqualityExpression(Expression expr)

compileRelationalExpression

protected java.lang.Object compileRelationalExpression(Expression expr)

compileAdditiveExpression

protected java.lang.Object compileAdditiveExpression(Expression expr)

compileMultiplicativeExpression

protected java.lang.Object compileMultiplicativeExpression(Expression expr)

compileUnaryExpression

protected java.lang.Object compileUnaryExpression(Expression expr)

compileUnaryExpressionNotPlusMinus

protected java.lang.Object compileUnaryExpressionNotPlusMinus(Expression expr)

compilePrimaryExpression

protected java.lang.Object compilePrimaryExpression(Expression expr)

processOrExpression

protected java.lang.Object processOrExpression(Expression expr)
Method to process the supplied OR expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processAndExpression

protected java.lang.Object processAndExpression(Expression expr)
Method to process the supplied AND expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processEqExpression

protected java.lang.Object processEqExpression(Expression expr)
Method to process the supplied EQ expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processNoteqExpression

protected java.lang.Object processNoteqExpression(Expression expr)
Method to process the supplied NOTEQ expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processLikeExpression

protected java.lang.Object processLikeExpression(Expression expr)
Method to process the supplied LIKE expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processGtExpression

protected java.lang.Object processGtExpression(Expression expr)
Method to process the supplied GT expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processLtExpression

protected java.lang.Object processLtExpression(Expression expr)
Method to process the supplied LT expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processGteqExpression

protected java.lang.Object processGteqExpression(Expression expr)
Method to process the supplied GTEQ expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processLteqExpression

protected java.lang.Object processLteqExpression(Expression expr)
Method to process the supplied LTEQ expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processIsExpression

protected java.lang.Object processIsExpression(Expression expr)
Method to process the supplied IS (instanceof) expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processAddExpression

protected java.lang.Object processAddExpression(Expression expr)
Method to process the supplied ADD expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processSubExpression

protected java.lang.Object processSubExpression(Expression expr)
Method to process the supplied SUB expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processMulExpression

protected java.lang.Object processMulExpression(Expression expr)
Method to process the supplied MUL expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processDivExpression

protected java.lang.Object processDivExpression(Expression expr)
Method to process the supplied DIV expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processModExpression

protected java.lang.Object processModExpression(Expression expr)
Method to process the supplied MOD expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processNegExpression

protected java.lang.Object processNegExpression(Expression expr)
Method to process the supplied NEG expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processComExpression

protected java.lang.Object processComExpression(Expression expr)
Method to process the supplied COM expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processNotExpression

protected java.lang.Object processNotExpression(Expression expr)
Method to process the supplied NOT expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processCreatorExpression

protected java.lang.Object processCreatorExpression(CreatorExpression expr)
Method to process the supplied creator expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processPrimaryExpression

protected java.lang.Object processPrimaryExpression(PrimaryExpression expr)
Method to process the supplied primary expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processParameterExpression

protected java.lang.Object processParameterExpression(ParameterExpression expr)
Method to process the supplied parameter expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processInvokeExpression

protected java.lang.Object processInvokeExpression(InvokeExpression expr)
Method to process the supplied invoke expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result

processLiteral

protected java.lang.Object processLiteral(Literal expr)
Method to process the supplied invoke expression. To be implemented by subclasses.

Parameters:
expr - The expression
Returns:
The result


Copyright © 2009. All Rights Reserved.