Project Wonder 5.0

er.extensions.foundation
Class ERXComparatorSupport

java.lang.Object
  extended by er.extensions.foundation.ERXComparatorSupport

public class ERXComparatorSupport
extends java.lang.Object

Useful methods when working with NSComparator.

Author:
Chuck Hill

Constructor Summary
ERXComparatorSupport()
           
 
Method Summary
static int compareWithNullsFirst(com.webobjects.foundation.NSComparator comparator, java.lang.Object object1, java.lang.Object object2)
          Compares object1 and object2 using comparator.
static int compareWithNullsLast(com.webobjects.foundation.NSComparator comparator, java.lang.Object object1, java.lang.Object object2)
          Compares object1 and object2 using comparator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXComparatorSupport

public ERXComparatorSupport()
Method Detail

compareWithNullsFirst

public static int compareWithNullsFirst(com.webobjects.foundation.NSComparator comparator,
                                        java.lang.Object object1,
                                        java.lang.Object object2)
                                 throws com.webobjects.foundation.NSComparator.ComparisonException
Compares object1 and object2 using comparator. If object1 or object2 is null/NSKeyValueCoding.NullValue it will sort before the other object.

Parameters:
comparator - NSComparator instance to use if both object1 and object2 are not null/NSKeyValueCoding.NullValue
object1 - first object to compare
object2 - second object to compare
Returns:
the result of comparing object1 to object2
Throws:
com.webobjects.foundation.NSComparator.ComparisonException - if comparator throws this comparing object1 to object2

compareWithNullsLast

public static int compareWithNullsLast(com.webobjects.foundation.NSComparator comparator,
                                       java.lang.Object object1,
                                       java.lang.Object object2)
                                throws com.webobjects.foundation.NSComparator.ComparisonException
Compares object1 and object2 using comparator. If object1 or object2 is null/NSKeyValueCoding.NullValue it will sort after the other object.

Parameters:
comparator - NSComparator instance to use if both object1 and object2 are not null/NSKeyValueCoding.NullValue
object1 - first object to compare
object2 - second object to compare
Returns:
the result of comparing object1 to object2
Throws:
com.webobjects.foundation.NSComparator.ComparisonException - if comparator throws this comparing object1 to object2

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.