org.datanucleus.store.mapped.expression
Class BooleanLiteral

java.lang.Object
  extended by org.datanucleus.store.mapped.expression.ScalarExpression
      extended by org.datanucleus.store.mapped.expression.BooleanExpression
          extended by org.datanucleus.store.mapped.expression.BooleanLiteral
All Implemented Interfaces:
Literal
Direct Known Subclasses:
BooleanBitColumnLiteral, BooleanCharColumnLiteral

public class BooleanLiteral
extends BooleanExpression
implements Literal

Representation of a Boolean literal in a Query.

Version:
$Revision: 1.5 $

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
BooleanLiteral(QueryExpression qs, JavaTypeMapping mapping, boolean value)
          Creates a boolean literal
 
Method Summary
 BooleanExpression and(ScalarExpression expr)
          Conditional And.
 BooleanExpression eor(ScalarExpression expr)
          Exclusive OR
 BooleanExpression eq(ScalarExpression expr)
          Equality operator (equals to)
protected  java.lang.String getBooleanFalseValue()
          Return the String value for FALSE in the database.
protected  java.lang.String getBooleanTrueValue()
          Return the String value for TRUE in the database.
 java.lang.Object getRawValue()
          Accessor for the "raw" value that this literal represents.
 java.lang.Object getValue()
          Accessor to the literal value
 BooleanExpression ior(ScalarExpression expr)
          Conditional OR.
 BooleanExpression not()
          Logical complement
 BooleanExpression noteq(ScalarExpression expr)
          Equality operator (not equals to)
 void setRawValue(java.lang.Object val)
          Method to save a "raw" value that this literal represents.
 
Methods inherited from class org.datanucleus.store.mapped.expression.BooleanExpression
in, neg
 
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

BooleanLiteral

public BooleanLiteral(QueryExpression qs,
                      JavaTypeMapping mapping,
                      boolean value)
Creates a boolean literal

Parameters:
qs - the QueryExpression
mapping - the mapping
value - the binary value
Method Detail

getValue

public java.lang.Object getValue()
Description copied from interface: Literal
Accessor to the literal value

Specified by:
getValue in interface Literal
Returns:
the value of the literal

getBooleanTrueValue

protected java.lang.String getBooleanTrueValue()
Return the String value for TRUE in the database. This should be overriden by subclasses for special cases of booleans.

Returns:
The String value for TRUE in the database.

getBooleanFalseValue

protected java.lang.String getBooleanFalseValue()
Return the String value for FALSE in the database. This should be overriden by subclasses for special cases of booleans.

Returns:
The String value for FALSE in the database.

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 BooleanExpression
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 BooleanExpression
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 BooleanExpression
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 BooleanExpression
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 BooleanExpression
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 BooleanExpression
Parameters:
expr - the right-hand operand
Returns:
The type of an equality expression is a boolean

setRawValue

public void setRawValue(java.lang.Object val)
Method to save a "raw" value that this literal represents. This value differs from the literal value since that is of the same type as this literal.

Specified by:
setRawValue in interface Literal
Parameters:
val - The raw value

getRawValue

public java.lang.Object getRawValue()
Accessor for the "raw" value that this literal represents. This value differs from the literal value since that is of the same type as this literal.

Specified by:
getRawValue in interface Literal
Returns:
The raw value


Copyright © 2010. All Rights Reserved.