ERXArrayUtilities.SortOperator Class Reference

Collaboration diagram for ERXArrayUtilities.SortOperator:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Object compute (NSArray<?> array, String keypath)
 SortOperator (NSSelector selector)

Private Attributes

NSSelector selector


Detailed Description

Define an NSArray.Operator for the key sort.

This allows for key value paths like:
  1. myArray.valueForKey("@sort.firstName");
  2. myArray.valueForKey("@sort.lastName,firstName.length");
Which in the first case would return myArray sorted ascending by first name and the second case by lastName and then by the length() of the firstName. Due to the way the sort key arguments are written, this key cannot occur anywhere except at the very end of the keypath.

Constructor & Destructor Documentation

SortOperator ( NSSelector  selector  ) 

public empty constructor


Member Function Documentation

Object compute ( NSArray<?>  array,
String  keypath 
)

Sorts the given array by the keypath.

Parameters:
array array to be sorted.
keypath sort key.
Returns:
immutable sorted array.


Member Data Documentation

NSSelector selector [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:12 2012 for Project Wonder by  doxygen 1.5.8