WebObjects 5.2.3

com.webobjects.eocontrol
Class EOSortOrdering.ComparisonSupport

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

public static class EOSortOrdering.ComparisonSupport
extends Object

ComparisonSupport provides default implementations of the EOSortOrdering.Comparison interface and a registry for support objects.


Constructor Summary
EOSortOrdering.ComparisonSupport()
           
 
Method Summary
 int compareAscending(Object left, Object right)
          Returns the ordering of left relative to right.
 int compareCaseInsensitiveAscending(Object left, Object right)
          Returns the ordering of left relative to right, ignoring case.
 int compareCaseInsensitiveDescending(Object left, Object right)
          Returns the ordering of left relative to right, ignoring case.
 int compareDescending(Object left, Object right)
          Returns the ordering of left relative to right.
static int compareValues(Object left, Object right, NSSelector selector)
          Compares the two objects using selector.
static void setSupportForClass(EOSortOrdering.ComparisonSupport support, Class aClass)
          Sets support as the support object to be used for comparing instances of aClass.
static EOSortOrdering.ComparisonSupport supportForClass(Class aClass)
          Returns the support object 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

EOSortOrdering.ComparisonSupport

public EOSortOrdering.ComparisonSupport()
Method Detail

compareAscending

public int compareAscending(Object left,
                            Object right)
Returns the ordering of left relative to right.

Parameters:
left - the left hand side object
right - the right hand side object
Returns:
NSComparator.OrderedAscending if right is naturally ordered after left, NSComparator.OrderedDescending if it's naturally ordered before left, and NSComparator.OrderedSame if they're equivalent for ordering purposes

compareCaseInsensitiveAscending

public int compareCaseInsensitiveAscending(Object left,
                                           Object right)
Returns the ordering of left relative to right, ignoring case.

Parameters:
left - the left hand side object
right - the right hand side object
Returns:
NSComparator.OrderedAscending if right is naturally ordered ignoring case after left, NSComparator.OrderedDescending if it's naturally ordered before left, and NSComparator.OrderedSame if they're equivalent for ordering purposes

compareCaseInsensitiveDescending

public int compareCaseInsensitiveDescending(Object left,
                                            Object right)
Returns the ordering of left relative to right, ignoring case.

Parameters:
left - the left hand side object
right - the right hand side object
Returns:
NSComparator.OrderedAscending if right is naturally ordered ignoring case before left, NSComparator.OrderedDescending if it's naturally ordered after left, and NSComparator.OrderedSame if they're equivalent for ordering purposes

compareDescending

public int compareDescending(Object left,
                             Object right)
Returns the ordering of left relative to right.

Parameters:
left - the left hand side object
right - the right hand side object
Returns:
NSComparator.OrderedAscending if right is naturally ordered before left, NSComparator.OrderedDescending if it's naturally ordered after left, and NSComparator.OrderedSame if they're equivalent for ordering purposes

compareValues

public static int 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 objects if appropriate.

Parameters:
left - the object to compare as the left hand side of the inequality
right - the object to compare as the right hand side of the inequality
selector - method selector to use to compare the left and right objects
Returns:
NSComparator.OrderedAscending if right is naturally ordered after left, NSComparator.OrderedDescending if it's naturally ordered before left, and NSComparator.OrderedSame if they're equivalent for ordering purposes

setSupportForClass

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

Parameters:
support - the comparison support object to be used when comparing instances of aClass
aClass - the Class of objects that will be compared using support

supportForClass

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

Parameters:
aClass - the Class to create a comparison support object for
Returns:
the support object used for doing sort ordering comparisons for instances of aClass

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

Copyright © 2004 Apple Computer, Inc.