er.extensions.foundation
Class ERXComparatorSelector
java.lang.Object
com.webobjects.foundation.NSSelector
er.extensions.foundation.ERXComparatorSelector
- All Implemented Interfaces:
- java.io.Serializable
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()))
- See Also:
- Serialized Form
- Author:
- mschrag
Fields inherited from class com.webobjects.foundation.NSSelector |
_CLASS, _name, _types |
Constructor Summary |
ERXComparatorSelector(java.util.Comparator comparator)
Constructs a new ERXComparatorSelector. |
Method Summary |
java.lang.Object |
invoke(java.lang.Object target,
java.lang.Object argument)
|
Methods inherited from class com.webobjects.foundation.NSSelector |
_safeInvokeMethod, _safeInvokeSelector, equals, hashCode, implementedByClass, implementedByObject, invoke, invoke, invoke, invoke, invoke, invoke, methodOnClass, methodOnObject, name, parameterTypes, toString |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
ERXComparatorSelector
public ERXComparatorSelector(java.util.Comparator comparator)
- Constructs a new ERXComparatorSelector.
- Parameters:
comparator
- the backing comparator to sort with
invoke
public java.lang.Object invoke(java.lang.Object target,
java.lang.Object argument)
throws java.lang.IllegalAccessException,
java.lang.IllegalArgumentException,
java.lang.reflect.InvocationTargetException,
java.lang.NoSuchMethodException
- Overrides:
invoke
in class com.webobjects.foundation.NSSelector
- Throws:
java.lang.IllegalAccessException
java.lang.IllegalArgumentException
java.lang.reflect.InvocationTargetException
java.lang.NoSuchMethodException
Copyright © 2002 – 2007 Project Wonder.