public class ERXComparatorSelector
extends com.webobjects.foundation.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()))
Constructor and Description |
---|
ERXComparatorSelector(Comparator comparator)
Constructs a new ERXComparatorSelector.
|
Modifier and Type | Method and Description |
---|---|
Object |
invoke(Object target,
Object argument) |
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 com.webobjects.foundation.NSSelector
IllegalAccessException
IllegalArgumentException
InvocationTargetException
NoSuchMethodException
Copyright © 2002 – 2020 Project Wonder.