er.extensions.foundation
Class ERXComparatorSupport
java.lang.Object
er.extensions.foundation.ERXComparatorSupport
public class ERXComparatorSupport
- extends Object
Useful methods when working with NSComparator.
- Author:
- Chuck Hill
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ERXComparatorSupport
public ERXComparatorSupport()
compareWithNullsFirst
public static int compareWithNullsFirst(NSComparator comparator,
Object object1,
Object object2)
throws 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.NullValueobject1 - first object to compareobject2 - second object to compare
- Returns:
- the result of comparing object1 to object2
- Throws:
NSComparator.ComparisonException - if comparator throws this comparing object1 to object2
compareWithNullsLast
public static int compareWithNullsLast(NSComparator comparator,
Object object1,
Object object2)
throws 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.NullValueobject1 - first object to compareobject2 - second object to compare
- Returns:
- the result of comparing object1 to object2
- Throws:
NSComparator.ComparisonException - if comparator throws this comparing object1 to object2
Copyright © 2002 – 2007 Project Wonder.