org.castor.cpa.persistence.sql.query.condition
Class Compare

java.lang.Object
  extended by org.castor.cpa.persistence.sql.query.condition.Condition
      extended by org.castor.cpa.persistence.sql.query.condition.Compare
All Implemented Interfaces:
QueryObject

public final class Compare
extends Condition

Compare 2 conditions with an operator.

Version:
$Revision: 8994 $ $Date: 2011-08-02 01:40:59 +0200 (Di, 02 Aug 2011) $
Author:
Ahmad Hassan, Ralf Joachim

Constructor Summary
Compare(Expression left, CompareOperator operator, Expression right)
          Constructor a compare condition that compares given left and rigth hand operand with given comparison operator.
 
Method Summary
 void accept(Visitor visitor)
          Accept method to handle incoming visitors.
 Expression leftExpression()
          Returns left operand of the comparison.
 Condition not()
          Builder method to invert a condition.
 CompareOperator operator()
          Returns operator of comparison.
 Expression rightExpression()
          Returns right operand of the comparison.
 java.lang.String toString()
          Method constructing query string.
 
Methods inherited from class org.castor.cpa.persistence.sql.query.condition.Condition
and, or
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Compare

public Compare(Expression left,
               CompareOperator operator,
               Expression right)
Constructor a compare condition that compares given left and rigth hand operand with given comparison operator.

Parameters:
left - Left operand of the comparison.
operator - Operator of comparison.
right - Right operand of the comparison.
Method Detail

leftExpression

public Expression leftExpression()
Returns left operand of the comparison.

Returns:
Left operand of the comparison.

operator

public CompareOperator operator()
Returns operator of comparison.

Returns:
Operator of comparison.

rightExpression

public Expression rightExpression()
Returns right operand of the comparison.

Returns:
right operand of the comparison.

not

public Condition not()
Description copied from class: Condition
Builder method to invert a condition. A condition that evaluated to TRUE before calling this method will evaluate to FALSE thereafter.

Specified by:
not in class Condition
Returns:
Negated condition.

accept

public void accept(Visitor visitor)
Accept method to handle incoming visitors.

Parameters:
visitor - Visitor to be handled.

toString

public java.lang.String toString()
Method constructing query string.

Overrides:
toString in class java.lang.Object
Returns:
Constructed query string.


Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com