org.josql.expressions
Class GTLTExpression

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

public class GTLTExpression
extends BinaryExpression

This class represents one of the following:

You can also force a "string" comparison by prefixing with "$". This will force both sides to be strings via the toString method.


Field Summary
 
Fields inherited from class org.josql.expressions.BinaryExpression
left, right
 
Constructor Summary
GTLTExpression()
           
 
Method Summary
 int getType()
           
 boolean isIgnoreCase()
           
 boolean isTrue(Object o, Query q)
          Return whether this expression evaluates to true.
 void setIgnoreCase(boolean v)
           
 void setType(int t)
          Type is an integer here for speed purposes, however one of the constants should be used.
 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
 

Constructor Detail

GTLTExpression

public GTLTExpression()
Method Detail

getType

public int getType()

setType

public void setType(int t)
Type is an integer here for speed purposes, however one of the constants should be used.

Parameters:
t - The type of expression.

setIgnoreCase

public void setIgnoreCase(boolean v)

isIgnoreCase

public boolean isIgnoreCase()

isTrue

public boolean isTrue(Object o,
                      Query q)
               throws QueryExecutionException
Return whether this expression evaluates to true. The actual comparison is performed by: Utilities.compare(Object,Object) which copes with the object types.

Specified by:
isTrue in class Expression
Parameters:
o - The current object to evaluate the expression on.
q - The Query object.
Returns:
true if the expression evaluates to true.
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:
A string version of the expression.


  Copyright © 2008 Gary Bentley. All Rights Reserved.