org.josql.expressions
Class EqualsExpression

java.lang.Object
  extended by org.josql.expressions.Expression
      extended by org.josql.expressions.BinaryExpression
          extended by org.josql.expressions.EqualsExpression

public class EqualsExpression
extends BinaryExpression

This class represents an "=" or "!=" expression. This class also provides the ability for the developer to prefix the "=" or "!=" with "$" to indicate that a case-insensitive comparison should be made, in which case the LHS and RHS are converted to strings first.


Field Summary
 boolean ignoreCase
           
 
Fields inherited from class org.josql.expressions.BinaryExpression
left, right
 
Constructor Summary
EqualsExpression()
           
 
Method Summary
 boolean isIgnoreCase()
           
 boolean isNot()
           
 boolean isTrue(Object o, Query q)
          Return whether this expression evaluates to true.
 void setIgnoreCase(boolean v)
           
 void setNot(boolean v)
           
 String toString()
          Return a string version of the expression.
 
Methods inherited from class org.josql.expressions.BinaryExpression
getExpectedReturnType, getLeft, getRight, getValue, hasFixedResult, init, setLeft, setRight
 
Methods inherited from class org.josql.expressions.Expression
isBracketed, setBracketed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ignoreCase

public boolean ignoreCase
Constructor Detail

EqualsExpression

public EqualsExpression()
Method Detail

setIgnoreCase

public void setIgnoreCase(boolean v)

isIgnoreCase

public boolean isIgnoreCase()

isNot

public boolean isNot()

setNot

public void setNot(boolean v)

isTrue

public boolean isTrue(Object o,
                      Query q)
               throws QueryExecutionException
Return whether this expression evaluates to true.

Specified by:
isTrue in class Expression
Parameters:
o - The current object to perform the expression on.
q - The Query object.
Returns:
true if the expression evaluates to true, false otherwise.
Throws:
QueryExecutionException - If the expression cannot be evaluated.

toString

public String toString()
Return a string version of the expression. In the form: Expression [ $ ] [ ! ] = Expression

Specified by:
toString in class Expression
Returns:
The string version.


  Copyright © 2008 Gary Bentley. All Rights Reserved.