public class ERXComparatorSelector extends NSSelector
ERXComparatorSelector allows you to pass an arbitrary Comparator instance as an NSSelector into EOSortOrdering for use with an in-memory sort. Note that this WILL NOT work for sorting directly in the database. This exploits the fact that EOSortOrdering calls selector.invoke(left, right) when you pass it an arbitrary selector to use.
Example: ERXArrayUtilities.sortedArraySortedWithKey(array, "someKey", new ERXComparatorSelector(Collator.getInstance()))
_CLASS, _name, _types
Constructor and Description |
---|
ERXComparatorSelector(Comparator comparator)
Constructs a new ERXComparatorSelector.
|
Modifier and Type | Method and Description |
---|---|
Object |
invoke(Object target,
Object argument) |
_safeInvokeMethod, _safeInvokeSelector, equals, hashCode, implementedByClass, implementedByObject, invoke, invoke, invoke, invoke, invoke, invoke, methodOnClass, methodOnObject, name, parameterTypes, toString
public ERXComparatorSelector(Comparator comparator)
comparator
- the backing comparator to sort withpublic Object invoke(Object target, Object argument) throws IllegalAccessException, IllegalArgumentException, InvocationTargetException, NoSuchMethodException
invoke
in class NSSelector
IllegalAccessException
IllegalArgumentException
InvocationTargetException
NoSuchMethodException
Copyright © 2002 – 2024 Project Wonder.