Holds attributes necessary to describe how to sort a set of objects. More...
Public Member Functions | |
| (BOOL) | - ascending [implementation] |
| (CPComparisonResult) | - compareObject:withObject: [implementation] |
| (id) | - initWithKey:ascending: [implementation] |
| (id) | - initWithKey:ascending:selector: [implementation] |
| (CPString) | - key [implementation] |
| (id) | - reversedSortDescriptor [implementation] |
| (SEL) | - selector [implementation] |
Static Public Member Functions | |
| (id) | + sortDescriptorWithKey:ascending: [implementation] |
| (id) | + sortDescriptorWithKey:ascending:selector: [implementation] |
Holds attributes necessary to describe how to sort a set of objects.
A CPSortDescriptor holds the attributes necessary to describe how to sort a set of objects. The sort descriptor instance holds a property key path to the sort item of the objects to compare, the method selector to call for sorting and the sort order.
Definition at line 55 of file CPSortDescriptor.j.
| - (BOOL) ascending | [implementation] |
Returns YES if the sort descriptor's order is ascending.
Definition at line 109 of file CPSortDescriptor.j.
| - (CPComparisonResult) compareObject: | (id) | lhsObject | ||
| withObject: | (id) | rhsObject | ||
[implementation] |
Compares two objects.
| lhsObject | the left hand side object to compre | |
| rhsObject | the right hand side object to compare |
Definition at line 137 of file CPSortDescriptor.j.
| - (id) initWithKey: | (CPString) | aKey | ||
| ascending: | (BOOL) | isAscending | ||
[implementation] |
Initializes the sort descriptor.
| aKey | the property key path to sort | |
| isAscending | the sort order |
Definition at line 74 of file CPSortDescriptor.j.
| - (id) initWithKey: | (CPString) | aKey | ||
| ascending: | (BOOL) | isAscending | ||
| selector: | (SEL) | aSelector | ||
[implementation] |
Initializes the sort descriptor
| aKey | the property key path to sort | |
| isAscending | the sort order | |
| aSelector | this method gets called to compare objects. The method will take one argument (the object to compare against itself, and must return a CPComparisonResult. |
Definition at line 91 of file CPSortDescriptor.j.
| - (CPString) key | [implementation] |
Returns the descriptor's property key
Definition at line 117 of file CPSortDescriptor.j.
| - (id) reversedSortDescriptor | [implementation] |
Makes a copy of this sort descriptor with a reversed sort order.
Definition at line 146 of file CPSortDescriptor.j.
| - (SEL) selector | [implementation] |
Returns the selector of the method to call when comparing objects.
Definition at line 125 of file CPSortDescriptor.j.
| + (id) sortDescriptorWithKey: | (CPString) | aKey | ||
| ascending: | (BOOL) | isAscending | ||
[implementation] |
Definition at line 62 of file CPSortDescriptor.j.
| + (id) sortDescriptorWithKey: | (CPString) | aKey | ||
| ascending: | (BOOL) | isAscending | ||
| selector: | (SEL) | aSelector | ||
[implementation] |
Definition at line 79 of file CPSortDescriptor.j.
1.6.1