Project Wonder 5.0.0.8795

er.extensions.foundation
Class ERXArrayUtilities.SortOperator

java.lang.Object
  extended by er.extensions.foundation.ERXArrayUtilities.SortOperator
All Implemented Interfaces:
NSArray.Operator
Enclosing class:
ERXArrayUtilities

public static class ERXArrayUtilities.SortOperator
extends Object
implements NSArray.Operator

Define an NSArray.Operator for the key sort.

This allows for key value paths like:

myArray.valueForKey("@sort.firstName");
myArray.valueForKey("@sort.lastName,firstName");

Which in the first case would return myArray sorted ascending by first name and the second case by lastName and then by firstName.


Constructor Summary
ERXArrayUtilities.SortOperator(NSSelector selector)
          public empty constructor
 
Method Summary
 Object compute(NSArray array, String keypath)
          Sorts the given array by the keypath.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXArrayUtilities.SortOperator

public ERXArrayUtilities.SortOperator(NSSelector selector)
public empty constructor

Method Detail

compute

public Object compute(NSArray array,
                      String keypath)
Sorts the given array by the keypath.

Specified by:
compute in interface NSArray.Operator
Parameters:
array - array to be sorted.
keypath - sort key.
Returns:
immutable sorted array.

Last updated: Fri, Jan 9, 2009 • 04:35 AM EST

Copyright © 2002 – 2007 Project Wonder.