isql.predicate
Class ComparisonPredicate

java.lang.Object
  extended by isql.predicate.ComparisonPredicate
All Implemented Interfaces:
IPredicate

public class ComparisonPredicate
extends java.lang.Object
implements IPredicate

It builds the view for a single comparison in the WHERE clause (a = b, a <> b...)

Author:
SHZ Sep 27, 2007

Constructor Summary
ComparisonPredicate(IExpression a, IExpression b, IComparison comparison)
           
 
Method Summary
 WhereView apply()
          Builds the view resulting from the comparison of the two expressions
static void fillViewMaps(java.lang.Object[] arrA, java.lang.Object[] arrB, WhereView viewA, WhereView viewB, IComparison comparison)
          Fills the views of A and B with the indices of the columns for the rows for which the comparison has success
static java.lang.Object[] toArray(ITypedValue res)
          Convert the content of a column into an array, whatever it is
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ComparisonPredicate

public ComparisonPredicate(IExpression a,
                           IExpression b,
                           IComparison comparison)
Method Detail

apply

public WhereView apply()
                throws ISQLException
Builds the view resulting from the comparison of the two expressions

Specified by:
apply in interface IPredicate
Returns:
the view
Throws:
ISQLException

fillViewMaps

public static void fillViewMaps(java.lang.Object[] arrA,
                                java.lang.Object[] arrB,
                                WhereView viewA,
                                WhereView viewB,
                                IComparison comparison)
                         throws ISQLException
Fills the views of A and B with the indices of the columns for the rows for which the comparison has success

Parameters:
arrA - the values of column A
arrB - the values of column B
viewA - the view related to column A, that gets filled with the indices
viewB - the view related to column B, that gets filled with the indices
comparison - the comparison operator
Throws:
ISQLException

toArray

public static java.lang.Object[] toArray(ITypedValue res)
Convert the content of a column into an array, whatever it is

Parameters:
res - the content of a column (can be an array or a constant)
Returns:
the final array

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object