![]() |
API 0.9.5
|
Holds attributes necessary to describe how to sort a set of objects. More...
#import <CPSortDescriptor.h>
Inheritance diagram for CPSortDescriptor:Instance Methods | |
| (BOOL) | - ascending |
| (CPComparisonResult) | - compareObject:withObject: |
| (CPString) | - description |
| (void) | - encodeWithCoder: |
| (id) | - initWithCoder: |
| (id) | - initWithKey:ascending: |
| (id) | - initWithKey:ascending:selector: |
| (CPString) | - key |
| (id) | - reversedSortDescriptor |
| (SEL) | - selector |
Class Methods | |
| (id) | + sortDescriptorWithKey:ascending: |
| (id) | + sortDescriptorWithKey:ascending:selector: |
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 2 of file CPSortDescriptor.h.
| - (BOOL) ascending |
Returns YES if the sort descriptor's order is ascending.
Definition at line 87 of file CPSortDescriptor.j.
| - (CPComparisonResult) compareObject: | (id) | lhsObject | |
| withObject: | (id) | rhsObject | |
Compares two objects.
| lhsObject | the left hand side object to compare |
| rhsObject | the right hand side object to compare |
Definition at line 115 of file CPSortDescriptor.j.
| - (CPString) description |
Definition at line 129 of file CPSortDescriptor.j.
| - (void) encodeWithCoder: | (CPCoder) | aCoder |
Definition at line 155 of file CPSortDescriptor.j.
| - (id) initWithCoder: | (CPCoder) | aCoder |
Definition at line 143 of file CPSortDescriptor.j.
| - (id) initWithKey: | (CPString) | aKey | |
| ascending: | (BOOL) | isAscending | |
Initializes the sort descriptor.
| aKey | the property key path to sort |
| isAscending | the sort order |
Definition at line 52 of file CPSortDescriptor.j.
| - (id) initWithKey: | (CPString) | aKey | |
| ascending: | (BOOL) | isAscending | |
| selector: | (SEL) | aSelector | |
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 69 of file CPSortDescriptor.j.
| - (CPString) key |
Returns the descriptor's property key
Definition at line 95 of file CPSortDescriptor.j.
| - (id) reversedSortDescriptor |
Makes a copy of this sort descriptor with a reversed sort order.
Definition at line 124 of file CPSortDescriptor.j.
| - (SEL) selector |
Returns the selector of the method to call when comparing objects.
Definition at line 103 of file CPSortDescriptor.j.
| + (id) sortDescriptorWithKey: | (CPString) | aKey | |
| ascending: | (BOOL) | isAscending | |
Definition at line 40 of file CPSortDescriptor.j.
| + (id) sortDescriptorWithKey: | (CPString) | aKey | |
| ascending: | (BOOL) | isAscending | |
| selector: | (SEL) | aSelector | |
Definition at line 57 of file CPSortDescriptor.j.