API  1.0.0
CPSortDescriptor Class Reference

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
 
- Instance Methods inherited from CPObject
(void) - addObserver:forKeyPath:options:context:
 
(void) - applyChange:toKeyPath:
 
(id) - autorelease
 
(id) - awakeAfterUsingCoder:
 
(void) - awakeFromCib
 
(void) - bind:toObject:withKeyPath:options:
 
(Class) - classForCoder
 
(Class) - classForKeyedArchiver
 
(CPString- className
 
(id) - copy
 
(void) - dealloc
 
(CPDictionary- dictionaryWithValuesForKeys:
 
(void) - didChange:valuesAtIndexes:forKey:
 
(void) - didChangeValueForKey:
 
(void) - didChangeValueForKey:withSetMutation:usingObjects:
 
(void) - doesNotRecognizeSelector:
 
(CPArray) - exposedBindings
 
(id) - forwardingTargetForSelector:
 
(void) - forwardInvocation:
 
(unsigned) - hash
 
(BOOL) - implementsSelector:
 
(CPDictionary- infoForBinding:
 
(id) - init
 
(BOOL) - isEqual:
 
(BOOL) - isKindOfClass:
 
(BOOL) - isMemberOfClass:
 
(BOOL) - isProxy
 
(IMP) - methodForSelector:
 
(CPMethodSignature) - methodSignatureForSelector:
 
(id) - mutableArrayValueForKey:
 
(id) - mutableArrayValueForKeyPath:
 
(id) - mutableCopy
 
(id) - mutableSetValueForKey:
 
(id) - mutableSetValueForKeyPath:
 
(id) - performSelector:
 
(id) - performSelector:withObject:
 
(void) - performSelector:withObject:afterDelay:
 
(void) - performSelector:withObject:afterDelay:inModes:
 
(id) - performSelector:withObject:withObject:
 
(id) - performSelector:withObjects:
 
(void) - release
 
(void) - removeObserver:forKeyPath:
 
(id) - replacementObjectForArchiver:
 
(id) - replacementObjectForCoder:
 
(id) - replacementObjectForKeyedArchiver:
 
(BOOL) - respondsToSelector:
 
(id) - retain
 
(id) - self
 
(void) - setValue:forKey:
 
(void) - setValue:forKeyPath:
 
(void) - setValue:forUndefinedKey:
 
(void) - setValuesForKeysWithDictionary:
 
(CPString- UID
 
(void) - unbind:
 
(Class) - valueClassForBinding:
 
(id) - valueForKey:
 
(id) - valueForKeyPath:
 
(id) - valueForUndefinedKey:
 
(void) - willChange:valuesAtIndexes:forKey:
 
(void) - willChangeValueForKey:
 
(void) - willChangeValueForKey:withSetMutation:usingObjects:
 

Class Methods

(id) + sortDescriptorWithKey:ascending:
 
(id) + sortDescriptorWithKey:ascending:selector:
 
- Class Methods inherited from CPObject
(BOOL) + accessInstanceVariablesDirectly
 
(id) + alloc
 
(id) + allocWithCoder:
 
(BOOL) + automaticallyNotifiesObserversForKey:
 
(void) + cancelPreviousPerformRequestsWithTarget:
 
(void) + cancelPreviousPerformRequestsWithTarget:selector:object:
 
(Class) + class
 
(BOOL) + conformsToProtocol:
 
(void) + exposeBinding:
 
(void) + initialize
 
(IMP) + instanceMethodForSelector:
 
(BOOL) + instancesImplementSelector:
 
(BOOL) + instancesRespondToSelector:
 
(BOOL) + isBindingExclusive:
 
(BOOL) + isSubclassOfClass:
 
(CPSet) + keyPathsForValuesAffectingValueForKey:
 
(void) + load
 
(id) + new
 
(void) + object:performSelector:withObject:afterDelay:inModes:
 
(void) + setVersion:
 
(Class) + superclass
 
(int) + version
 

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

◆ ascending()

- (BOOL) ascending
implementation

Returns YES if the sort descriptor's order is ascending.

Definition at line 87 of file CPSortDescriptor.j.

◆ compareObject:withObject:()

- (CPComparisonResult) compareObject: (id)  lhsObject
withObject: (id)  rhsObject 
implementation

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.

◆ description()

- (CPString) description
implementation

Returns a human readable string describing the receiver

Reimplemented from CPObject.

Definition at line 129 of file CPSortDescriptor.j.

◆ encodeWithCoder:()

- (void) encodeWithCoder: (CPCoder aCoder
implementation

Provided by category CPSortDescriptor(CPCoding).

Definition at line 155 of file CPSortDescriptor.j.

◆ initWithCoder:()

- (id) initWithCoder: (CPCoder aCoder
implementation

Provided by category CPSortDescriptor(CPCoding).

Definition at line 143 of file CPSortDescriptor.j.

◆ initWithKey:ascending:()

- (id) initWithKey: (CPString aKey
ascending: (BOOL)  isAscending 
implementation

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.

◆ initWithKey:ascending:selector:()

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

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.

◆ key()

- (CPString) key
implementation

Returns the descriptor's property key

Definition at line 95 of file CPSortDescriptor.j.

◆ reversedSortDescriptor()

- (id) reversedSortDescriptor
implementation

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.

◆ selector()

- (SEL) selector
implementation

Returns the selector of the method to call when comparing objects.

Definition at line 103 of file CPSortDescriptor.j.

◆ sortDescriptorWithKey:ascending:()

+ (id) sortDescriptorWithKey: (CPString aKey
ascending: (BOOL)  isAscending 
implementation

Definition at line 40 of file CPSortDescriptor.j.

◆ sortDescriptorWithKey:ascending:selector:()

+ (id) sortDescriptorWithKey: (CPString aKey
ascending: (BOOL)  isAscending
selector: (SEL)  aSelector 
implementation

Definition at line 57 of file CPSortDescriptor.j.


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