org.datanucleus.store.mapped.expression
Class BooleanExpression

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.BooleanExpression
Direct Known Subclasses:
BooleanBitColumnExpression, BooleanCharColumnExpression, BooleanLiteral, ExistsExpression, InExpression, LikeExpression, SubqueryExpression

public class BooleanExpression
extends ScalarExpression

Representation of a Boolean expression in a Query.

Version:
$Revision: 1.12 $

Nested Class Summary
 
Nested classes/interfaces inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
ScalarExpression.DatastoreFieldExpression, ScalarExpression.DyadicOperator, ScalarExpression.ExpressionList, ScalarExpression.IllegalArgumentTypeException, ScalarExpression.IllegalOperationException, ScalarExpression.MethodInvocationException, ScalarExpression.MonadicOperator, ScalarExpression.Operator
 
Field Summary
 
Fields inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
aliasIdentifier, checkForTypeAssignability, expressionList, FILTER, LOCALISER, lowestOperator, mapping, OP_ADD, OP_AND, OP_BETWEEN, OP_COM, OP_CONCAT, OP_DIV, OP_EQ, OP_GT, OP_GTEQ, OP_IN, OP_IS, OP_ISNOT, OP_LIKE, OP_LT, OP_LTEQ, OP_MOD, OP_MUL, OP_NEG, OP_NOT, OP_NOTEQ, OP_NOTIN, OP_NOTLIKE, OP_OR, OP_SUB, parameterName, PROJECTION, qs, st, te
 
Constructor Summary
protected BooleanExpression(QueryExpression qs)
          Constructor
  BooleanExpression(QueryExpression qs, JavaTypeMapping mapping, LogicSetExpression te)
           
  BooleanExpression(ScalarExpression.MonadicOperator op, ScalarExpression operand)
          Perform a boolean operator op on a operand operand
  BooleanExpression(ScalarExpression operand1, ScalarExpression.DyadicOperator op, ScalarExpression operand2)
          Perform a boolean operator op between two operands operand1 and operand2
 
Method Summary
 BooleanExpression and(ScalarExpression expr)
          Conditional And.
 BooleanExpression eor(ScalarExpression expr)
          Exclusive OR
 BooleanExpression eq(ScalarExpression expr)
          Equality operator (equals to)
 BooleanExpression in(ScalarExpression expr)
          In expression.
 BooleanExpression ior(ScalarExpression expr)
          Conditional OR.
 ScalarExpression neg()
          Unary Minus Operator
 BooleanExpression not()
          Logical complement
 BooleanExpression noteq(ScalarExpression expr)
          Equality operator (not equals to)
 
Methods inherited from class org.datanucleus.store.mapped.expression.ScalarExpression
accessField, add, as, assertValidTypeForParameterComparison, callMethod, cast, checkForTypeAssignability, com, div, encloseWithInParentheses, equals, getAlias, getConsistentTypeForParameterComparison, getExpressionList, getLogicSetExpression, getMapping, getNonAliasExpression, getQueryExpression, gt, gteq, instanceOf, lt, lteq, mod, mul, setParameterName, sub, toStatementText, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BooleanExpression

protected BooleanExpression(QueryExpression qs)
Constructor

Parameters:
qs - the QueryExpression

BooleanExpression

public BooleanExpression(QueryExpression qs,
                         JavaTypeMapping mapping,
                         LogicSetExpression te)
Parameters:
qs - the QueryExpression
mapping - the mapping associated to this expression
te - the TableExpression where this expression refers to

BooleanExpression

public BooleanExpression(ScalarExpression.MonadicOperator op,
                         ScalarExpression operand)
Perform a boolean operator op on a operand operand

Parameters:
op - the operator
operand - the operand

BooleanExpression

public BooleanExpression(ScalarExpression operand1,
                         ScalarExpression.DyadicOperator op,
                         ScalarExpression operand2)
Perform a boolean operator op between two operands operand1 and operand2

Parameters:
op - the operator
operand1 - the operand
operand2 - the operand
Method Detail

and

public BooleanExpression and(ScalarExpression expr)
Description copied from class: ScalarExpression
Conditional And. Evaluates its right-hand operand only if the value of its left-hand operand is true.

Overrides:
and in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is true if both operand values are true; otherwise, the result is false.

eor

public BooleanExpression eor(ScalarExpression expr)
Description copied from class: ScalarExpression
Exclusive OR

Overrides:
eor in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is the bitwise exclusive OR of the operand values.

ior

public BooleanExpression ior(ScalarExpression expr)
Description copied from class: ScalarExpression
Conditional OR. Evaluates its right-hand operand only if the value of its left-hand operand is false.

Overrides:
ior in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
the result value is false if both operand values are false; otherwise, the result is true.

not

public BooleanExpression not()
Description copied from class: ScalarExpression
Logical complement

Overrides:
not in class ScalarExpression
Returns:
the result value is false if operand is true; otherwise, the result is true.

eq

public BooleanExpression eq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (equals to)

Overrides:
eq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

noteq

public BooleanExpression noteq(ScalarExpression expr)
Description copied from class: ScalarExpression
Equality operator (not equals to)

Overrides:
noteq in class ScalarExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

in

public BooleanExpression in(ScalarExpression expr)
Description copied from class: ScalarExpression
In expression. Return true if this is contained by expr

Overrides:
in in class ScalarExpression
Parameters:
expr - the right-hand expression
Returns:
true if the left-hand expression is contained by the right-hand expression. Otherwise the result is false.

neg

public ScalarExpression neg()
Description copied from class: ScalarExpression
Unary Minus Operator

Overrides:
neg in class ScalarExpression
Returns:
the type of the unary minus expression is the promoted type of the operand.


Copyright © 2010. All Rights Reserved.