Class Expression
java.lang.Object
org.datanucleus.store.query.expression.Expression
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ArrayExpression, CaseExpression, ClassExpression, CreatorExpression, DyadicExpression, InvokeExpression, JoinExpression, Literal, OrderExpression, ParameterExpression, PrimaryExpression, SubqueryExpression, TypeExpression, VariableExpression
A Scalar expression in a Query. Used to compute values with a resulting type.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class"Dyadic" operator performs operation on one or two operands.static class"Monadic" operator performs a function on one operand.static classRepresentation of an Operator. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected Expressionprotected Expression.Operatorstatic final Expression.DyadicOperatorADDstatic final Expression.DyadicOperatorANDstatic final Expression.DyadicOperatorBITWISE ANDstatic final Expression.DyadicOperatorBITWISE ORstatic final Expression.DyadicOperatorBITWISE XORstatic final Expression.DyadicOperatorISstatic final Expression.MonadicOperatorCOMstatic final Expression.DyadicOperatorCONCATstatic final Expression.MonadicOperatorDISTINCTstatic final Expression.DyadicOperatorDIVstatic final Expression.DyadicOperatorEQstatic final Expression.DyadicOperatorGTstatic final Expression.DyadicOperatorGTEQstatic final Expression.DyadicOperatorINstatic final Expression.DyadicOperatorISstatic final Expression.DyadicOperatorISNOTstatic final Expression.DyadicOperatorLIKEstatic final Expression.DyadicOperatorLTstatic final Expression.DyadicOperatorLTEQstatic final Expression.DyadicOperatorMODstatic final Expression.DyadicOperatorMULstatic final Expression.MonadicOperatorNEGstatic final Expression.MonadicOperatorNOTstatic final Expression.DyadicOperatorNOTEQstatic final Expression.DyadicOperatorNOTINstatic final Expression.DyadicOperatorORstatic final Expression.DyadicOperatorSUBprotected ExpressionParent of this expression in the tree (if any).protected Expressionprivate static final longprotected Symbol -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstructor.protectedExpression(Expression.MonadicOperator op, Expression operand) Perform a functionoponoperandprotectedExpression(Expression operand1, Expression.DyadicOperator op, Expression operand2) Performs a function on two arguments. -
Method Summary
Modifier and TypeMethodDescriptionabstract Symbolbind(SymbolTable symtbl) Method to bind the expression to the symbol table as appropriate.evaluate(ExpressionEvaluator eval) Method to evaluate this expression, using the passed evaluator.getAlias()getLeft()Accessor for the left hand expression.The operator to be performed by this expression.Accessor for the parent expression where this expression is access from.getRight()Accessor for the right hand expression.Accessor for the symbol for this expression (if set).voidvoidsetLeft(Expression expr) voidsetRight(Expression expr)
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
parent
Parent of this expression in the tree (if any). -
op
-
left
-
right
-
symbol
-
alias
-
OP_OR
OR -
OP_AND
AND -
OP_NOT
NOT -
OP_EQ
EQ -
OP_NOTEQ
NOTEQ -
OP_LT
LT -
OP_LTEQ
LTEQ -
OP_GT
GT -
OP_GTEQ
GTEQ -
OP_LIKE
LIKE -
OP_IS
IS -
OP_ISNOT
ISNOT -
OP_CAST
IS -
OP_IN
IN -
OP_NOTIN
NOTIN -
OP_BIT_OR
BITWISE OR -
OP_BIT_XOR
BITWISE XOR -
OP_BIT_AND
BITWISE AND -
OP_ADD
ADD -
OP_SUB
SUB -
OP_CONCAT
CONCAT -
OP_MUL
MUL -
OP_DIV
DIV -
OP_MOD
MOD -
OP_NEG
NEG -
OP_COM
COM -
OP_DISTINCT
DISTINCT
-
-
Constructor Details
-
Expression
protected Expression()Constructor. -
Expression
Perform a functionoponoperand- Parameters:
op- operatoroperand- operand
-
Expression
Performs a function on two arguments. op(operand1,operand2) operand1 op operand2- Parameters:
operand1- the first expressionop- the operator between operandsoperand2- the second expression
-
-
Method Details
-
getParent
Accessor for the parent expression where this expression is access from.- Returns:
- Parent expression
-
setLeft
-
setRight
-
getOperator
The operator to be performed by this expression. See the OP_{name} final static properties of this class.- Returns:
- Operator
-
getLeft
-
getRight
-
getSymbol
-
setAlias
-
getAlias
-
evaluate
Method to evaluate this expression, using the passed evaluator.- Parameters:
eval- Evaluator- Returns:
- The result
-
bind
Method to bind the expression to the symbol table as appropriate.- Parameters:
symtbl- Symbol table- Returns:
- The symbol for this expression
-