WebObjects 5.2.3

com.webobjects.eocontrol
Class EOQualifier.ComparisonSupport

java.lang.Object
  extended bycom.webobjects.eocontrol.EOQualifier.ComparisonSupport
Enclosing class:
EOQualifier

public static class EOQualifier.ComparisonSupport
extends Object

The Java Client EOQualifier.ComparisonSupport class provides default implementations of the EOQualifierComparison interface.

The Java Client EOCustomObject uses EOQualifier.ComparisonSupport's default implementations. Typically the custom enterprise object classes inherit from EOCustomObject and inherit the default implementations. If the custom enterprise object class doesn't inherit from EOCustomObject, you should implement the EOQualifierComparison interface directly.


Constructor Summary
EOQualifier.ComparisonSupport()
           
 
Method Summary
static boolean compareValues(Object left, Object right, NSSelector selector)
          Compares the two objects using selector.
 boolean doesContain(Object left, Object right)
          Returns true if receiver contains right, false if it doesn't.
 boolean isCaseInsensitiveLike(Object left, Object right)
          Returns true if receiver is a case insensitive match for right, false if it isn't.
 boolean isEqualTo(Object left, Object right)
          Invokes equals and returns the result.
 boolean isGreaterThan(Object left, Object right)
          Invokes compare and returns true if the result is NSComparator.OrderedDescending.
 boolean isGreaterThanOrEqualTo(Object left, Object right)
          Invokes compare and returns true if the result is NSComparator.OrderedDescending or NSComparator.OrderedSame.
 boolean isLessThan(Object left, Object right)
          Invokes compare and returns true if the result is NSComparator.OrderedAscending.
 boolean isLessThanOrEqualTo(Object left, Object right)
          Invokes compare and returns true if the result is NSComparator.OrderedAscending or NSComparator.OrderedSame.
 boolean isLike(Object left, Object right)
          Returns true if receiver matches right according to the semantics of the SQL like comparison operator, false if it doesn't.
 boolean isNotEqualTo(Object left, Object right)
          Invokes equals, inverts the result, and returns it.
static void setSupportForClass(EOQualifier.ComparisonSupport supportClass, Class aClass)
          Sets aClass as the support class to be used for comparing instances of aClass.
static EOQualifier.ComparisonSupport supportForClass(Class aClass)
          Returns the support class used for doing sort ordering comparisons for instances of aClass.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EOQualifier.ComparisonSupport

public EOQualifier.ComparisonSupport()
Method Detail

compareValues

public static boolean compareValues(Object left,
                                    Object right,
                                    NSSelector selector)
Compares the two objects using selector. You should use this method to compare value objects instead of calling selector directly. This method is the entry point for the comparison support, and calls methods in support classes if appropriate.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
selector - The array to compare objects
Returns:
True if both the input object and the receiver are equal else false

doesContain

public boolean doesContain(Object left,
                           Object right)
Returns true if receiver contains right, false if it doesn't. NSObject's implementation of this method returns true only if receiver is a kind of NSArray and contains right. In all other cases it returns false. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if receiver contains anObject, false if it doesn't

isCaseInsensitiveLike

public boolean isCaseInsensitiveLike(Object left,
                                     Object right)
Returns true if receiver is a case insensitive match for right, false if it isn't. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if receiver is a case insensitive match for anObject, false if it isn't

isEqualTo

public boolean isEqualTo(Object left,
                         Object right)
Invokes equals and returns the result. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
True if both the input object and the receiver are equal else false

isGreaterThan

public boolean isGreaterThan(Object left,
                             Object right)
Invokes compare and returns true if the result is NSComparator.OrderedDescending. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if the result is NSComparator.OrderedDescending false otherwise

isGreaterThanOrEqualTo

public boolean isGreaterThanOrEqualTo(Object left,
                                      Object right)
Invokes compare and returns true if the result is NSComparator.OrderedDescending or NSComparator.OrderedSame. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if the result is NSComparator.OrderedDescending or NSComparator.OrderedSame else false

isLessThan

public boolean isLessThan(Object left,
                          Object right)
Invokes compare and returns true if the result is NSComparator.OrderedAscending. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if the result is NSComparator.OrderedAscending

isLessThanOrEqualTo

public boolean isLessThanOrEqualTo(Object left,
                                   Object right)
Invokes compare and returns true if the result is NSComparator.OrderedAscending or NSComparator.OrderedSame. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if the result is NSComparator.OrderedAscending or NSComparator.OrderedSame

isLike

public boolean isLike(Object left,
                      Object right)
Returns true if receiver matches right according to the semantics of the SQL like comparison operator, false if it doesn't. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
true if receiver matches anObject according to the semantics of the SQL like comparison operator, false if it doesn't

isNotEqualTo

public boolean isNotEqualTo(Object left,
                            Object right)
Invokes equals, inverts the result, and returns it. This method is used in the Framework only by EOQualifier for in-memory evaluation.

Parameters:
left - One of the objects to be compared
right - One of the objects to be compared
Returns:
the inverted result of equals

setSupportForClass

public static void setSupportForClass(EOQualifier.ComparisonSupport supportClass,
                                      Class aClass)
Sets aClass as the support class to be used for comparing instances of aClass. When compareValues is called, the methods in supportClass are used to do the comparison for instances of aClass.

Parameters:
supportClass - support class to be used for comparing
aClass - the class to be compared

supportForClass

public static EOQualifier.ComparisonSupport supportForClass(Class aClass)
Returns the support class used for doing sort ordering comparisons for instances of aClass.

Parameters:
aClass - The input class to be compared
Returns:
the support class used for doing sort ordering comparisons

Last updated Thu Oct 21 15:04:16 PDT 2004.

Copyright © 2004 Apple Computer, Inc.