Project Wonder 5.0

er.extensions.foundation
Class ERXComparatorSelector

java.lang.Object
  extended by com.webobjects.foundation.NSSelector
      extended by 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

Field Summary
 
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
 

Constructor Detail

ERXComparatorSelector

public ERXComparatorSelector(java.util.Comparator comparator)
Constructs a new ERXComparatorSelector.

Parameters:
comparator - the backing comparator to sort with
Method Detail

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

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

Copyright © 2002 – 2007 Project Wonder.