API 0.9.5
CPSortDescriptor Class Reference

Holds attributes necessary to describe how to sort a set of objects. More...

#import <CPSortDescriptor.h>

Inheritance diagram for CPSortDescriptor:

List of all members.

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:

Detailed Description

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.


Method Documentation

- (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.

Parameters:
lhsObjectthe left hand side object to compare
rhsObjectthe right hand side object to compare
Returns:
the comparison result

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.

Parameters:
aKeythe property key path to sort
isAscendingthe sort order
Returns:
the initialized sort descriptor

Definition at line 52 of file CPSortDescriptor.j.

- (id) initWithKey: (CPString aKey
ascending: (BOOL)  isAscending
selector: (SEL)  aSelector 

Initializes the sort descriptor

Parameters:
aKeythe property key path to sort
isAscendingthe sort order
aSelectorthis 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.

Returns:
the reversed copy of the sort descriptor

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.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Defines