A mutable array backed by a JavaScript Array.A mutable array class backed by a JavaScript Array. There is also a CPMutableArray class, but it is just a child class of this class with an empty implementation. All mutable functionality is implemented directly in CPArray. More...
Public Member Functions | |
(void) | - addObject: [implementation] |
(void) | - addObjectsFromArray: [implementation] |
(CPArray) | - arrayByAddingObject: [implementation] |
(CPArray) | - arrayByAddingObjectsFromArray: [implementation] |
(CPString) | - componentsJoinedByString: [implementation] |
(BOOL) | - containsObject: [implementation] |
(id) | - copy [implementation] |
(int) | - count [implementation] |
(CPString) | - description [implementation] |
(void) | - encodeWithCoder: [implementation] |
(void) | - exchangeObjectAtIndex:withObjectAtIndex: [implementation] |
(id) | - firstObjectCommonWithArray: [implementation] |
(int) | - indexOfObject: [implementation] |
(int) | - indexOfObject:inRange: [implementation] |
(unsigned) | - indexOfObject:sortedByDescriptors: [implementation] |
(unsigned) | - indexOfObject:sortedByFunction: [implementation] |
(unsigned) | - indexOfObject:sortedByFunction:context: [implementation] |
(unsigned) | - indexOfObject:sortedBySelector: [implementation] |
(int) | - indexOfObjectIdenticalTo: [implementation] |
(int) | - indexOfObjectIdenticalTo:inRange: [implementation] |
(id) | - init [implementation] |
(id) | - initWithArray: [implementation] |
(id) | - initWithArray:copyItems: [implementation] |
(id) | - initWithCapacity: [implementation] |
(id) | - initWithCoder: [implementation] |
(id) | - initWithObjects: [implementation] |
(id) | - initWithObjects:count: [implementation] |
(void) | - insertObject:atIndex: [implementation] |
(void) | - insertObjects:atIndexes: [implementation] |
(BOOL) | - isEqual: [implementation] |
(BOOL) | - isEqualToArray: [implementation] |
(id) | - lastObject [implementation] |
(void) | - makeObjectsPerformSelector: [implementation] |
(void) | - makeObjectsPerformSelector:withObject: [implementation] |
(void) | - makeObjectsPerformSelector:withObjects: [implementation] |
(id) | - objectAtIndex: [implementation] |
(CPEnumerator) | - objectEnumerator [implementation] |
(CPArray) | - objectsAtIndexes: [implementation] |
(CPArray) | - pathsMatchingExtensions: [implementation] |
(void) | - removeAllObjects [implementation] |
(void) | - removeLastObject [implementation] |
(void) | - removeObject: [implementation] |
(void) | - removeObject:inRange: [implementation] |
(void) | - removeObjectAtIndex: [implementation] |
(void) | - removeObjectIdenticalTo: [implementation] |
(void) | - removeObjectIdenticalTo:inRange: [implementation] |
(void) | - removeObjectsAtIndexes: [implementation] |
(void) | - removeObjectsInArray: [implementation] |
(void) | - removeObjectsInRange: [implementation] |
(void) | - replaceObjectAtIndex:withObject: [implementation] |
(void) | - replaceObjectsAtIndexes:withObjects: [implementation] |
(void) | - replaceObjectsInRange:withObjectsFromArray: [implementation] |
(void) | - replaceObjectsInRange:withObjectsFromArray:range: [implementation] |
(CPEnumerator) | - reverseObjectEnumerator [implementation] |
(void) | - setArray: [implementation] |
(void) | - setValue:forKey: [implementation] |
(void) | - setValue:forKeyPath: [implementation] |
(CPArray) | - sortedArrayUsingDescriptors: [implementation] |
(CPArray) | - sortedArrayUsingFunction: [implementation] |
(CPArray) | - sortedArrayUsingFunction:context: [implementation] |
(CPArray) | - sortedArrayUsingSelector: [implementation] |
(CPArray) | - sortUsingDescriptors: [implementation] |
(void) | - sortUsingFunction:context: [implementation] |
(void) | - sortUsingSelector: [implementation] |
(CPArray) | - subarrayWithRange: [implementation] |
(id) | - valueForKey: [implementation] |
(id) | - valueForKeyPath: [implementation] |
Static Public Member Functions | |
(id) | + array [implementation] |
(id) | + arrayWithArray: [implementation] |
(CPArray) | + arrayWithCapacity: [implementation] |
(id) | + arrayWithObject: [implementation] |
(id) | + arrayWithObjects: [implementation] |
(id) | + arrayWithObjects:count: [implementation] |
A mutable array backed by a JavaScript Array.
A mutable array class backed by a JavaScript Array. There is also a CPMutableArray class, but it is just a child class of this class with an empty implementation. All mutable functionality is implemented directly in CPArray.
Definition at line 302 of file CPArray+KVO.j.
- (void) addObject: | (id) | anObject | [implementation] |
- (void) addObjectsFromArray: | (CPArray) | anArray | [implementation] |
+ (id) array | [implementation] |
- (CPArray) arrayByAddingObject: | (id) | anObject | [implementation] |
+ (id) arrayWithArray: | (CPArray) | anArray | [implementation] |
+ (CPArray) arrayWithCapacity: | (unsigned) | aCapacity | [implementation] |
+ (id) arrayWithObject: | (id) | anObject | [implementation] |
+ (id) arrayWithObjects: | (id) | anObject | ||
, | ... | |||
[implementation] |
+ (id) arrayWithObjects: | (id) | objects | ||
count: | (unsigned) | aCount | ||
[implementation] |
Returns a string formed by concatenating the objects in the receiver, with the specified separator string inserted between each part. If the element is a Objective-J object, then the -description
of that object will be used, otherwise the default JavaScript representation will be used.
aString | the separator that will separate each object string |
- (BOOL) containsObject: | (id) | anObject | [implementation] |
- (id) copy | [implementation] |
- (int) count | [implementation] |
- (CPString) description | [implementation] |
- (void) encodeWithCoder: | (CPCoder) | aCoder | [implementation] |
- (void) exchangeObjectAtIndex: | (unsigned) | anIndex | ||
withObjectAtIndex: | (unsigned) | otherIndex | ||
[implementation] |
- (id) firstObjectCommonWithArray: | (CPArray) | anArray | [implementation] |
- (int) indexOfObject: | (id) | anObject | [implementation] |
- (int) indexOfObject: | (id) | anObject | ||
inRange: | (CPRange) | aRange | ||
[implementation] |
Returns the index of anObject
in the array within aRange
. It first attempts to find a match using -isEqual
:, then ==
.
anObject | the object to search for | |
aRange | the range to search within |
CPNotFound
if it was not found. - (unsigned) indexOfObject: | (id) | anObject | ||
sortedByDescriptors: | (CPArray) | descriptors | ||
[implementation] |
Returns the index of anObject
in the array, which must be sorted in the same order as calling sortUsingDescriptors: with the descriptors passed to this method would result in.
anObject | the object to search for | |
descriptors | the array of descriptors to use to compare each item in the array that we search. the same descriptors should have been used to sort the array (or to maintain its sorted order). |
CPNotFound
if it was not found. - (unsigned) indexOfObject: | (id) | anObject | ||
sortedByFunction: | (Function) | aFunction | ||
[implementation] |
Returns the index of anObject
in the array, which must be sorted in the same order as calling sortUsingFunction: with the selector passed to this method would result in. The function will be called like so:
aFunction(anObject, currentObjectInArrayForComparison)
anObject | the object to search for | |
aFunction | the comparison function to call on each item in the array that we search. the same selector should have been used to sort the array (or to maintain its sorted order). |
CPNotFound
if it was not found. - (unsigned) indexOfObject: | (id) | anObject | ||
sortedByFunction: | (Function) | aFunction | ||
context: | (id) | aContext | ||
[implementation] |
Returns the index of anObject
in the array, which must be sorted in the same order as calling sortUsingFunction: with the selector passed to this method would result in. The function will be called like so:
aFunction(anObject, currentObjectInArrayForComparison, context)
anObject | the object to search for | |
aFunction | the comparison function to call on each item in the array that we search. the same function should have been used to sort the array (or to maintain its sorted order). | |
aContext | a context object that will be passed to the sort function |
CPNotFound
if it was not found. - (unsigned) indexOfObject: | (id) | anObject | ||
sortedBySelector: | (SEL) | aSelector | ||
[implementation] |
Returns the index of anObject
in the array, which must be sorted in the same order as calling sortUsingSelector: with the selector passed to this method would result in.
anObject | the object to search for | |
aSelector | the comparison selector to call on each item in the list, the same selector should have been used to sort the array (or to maintain its sorted order). |
CPNotFound
if it was not found. - (int) indexOfObjectIdenticalTo: | (id) | anObject | [implementation] |
- (int) indexOfObjectIdenticalTo: | (id) | anObject | ||
inRange: | (CPRange) | aRange | ||
[implementation] |
- (id) init | [implementation] |
- (id) initWithArray: | (CPArray) | anArray | [implementation] |
- (id) initWithArray: | (CPArray) | anArray | ||
copyItems: | (BOOL) | copyItems | ||
[implementation] |
Initializes a the array with the contents of anArray
and optionally performs a deep copy of the objects based on copyItems
.
anArray | the array to copy the data from | |
copyItems | if YES , each object will be copied by having a -copy message sent to it, and the returned object will be added to the receiver. Otherwise, no copying will be performed. |
- (id) initWithCapacity: | (unsigned) | aCapacity | [implementation] |
- (id) initWithObjects: | (Array) | anArray | ||
, | ... | |||
[implementation] |
- (id) initWithObjects: | (id) | objects | ||
count: | (unsigned) | aCount | ||
[implementation] |
- (void) insertObject: | (id) | anObject | ||
atIndex: | (int) | anIndex | ||
[implementation] |
- (void) insertObjects: | (CPArray) | objects | ||
atIndexes: | (CPIndexSet) | indexes | ||
[implementation] |
- (BOOL) isEqualToArray: | (id) | anArray | [implementation] |
- (id) lastObject | [implementation] |
- (void) makeObjectsPerformSelector: | (SEL) | aSelector | [implementation] |
- (void) makeObjectsPerformSelector: | (SEL) | aSelector | ||
withObject: | (id) | anObject | ||
[implementation] |
- (void) makeObjectsPerformSelector: | (SEL) | aSelector | ||
withObjects: | (CPArray) | objects | ||
[implementation] |
- (id) objectAtIndex: | (int) | anIndex | [implementation] |
- (CPEnumerator) objectEnumerator | [implementation] |
- (CPArray) objectsAtIndexes: | (CPIndexSet) | indexes | [implementation] |
Returns a new array subset formed by selecting the elements that have filename extensions from filterTypes
. Only elements that are of type CPString are candidates for inclusion in the returned array.
filterTypes | an array of CPString objects that contain file extensions (without the '.') |
- (void) removeAllObjects | [implementation] |
- (void) removeLastObject | [implementation] |
- (void) removeObject: | (id) | anObject | [implementation] |
- (void) removeObject: | (id) | anObject | ||
inRange: | (CPRange) | aRange | ||
[implementation] |
- (void) removeObjectAtIndex: | (int) | anIndex | [implementation] |
- (void) removeObjectIdenticalTo: | (id) | anObject | [implementation] |
- (void) removeObjectIdenticalTo: | (id) | anObject | ||
inRange: | (CPRange) | aRange | ||
[implementation] |
- (void) removeObjectsAtIndexes: | (CPIndexSet) | anIndexSet | [implementation] |
Removes the objects at the indices specified by CPIndexSet
.
anIndexSet | the indices of the elements to be removed from the array |
- (void) removeObjectsInArray: | (CPArray) | anArray | [implementation] |
- (void) removeObjectsInRange: | (CPRange) | aRange | [implementation] |
- (void) replaceObjectAtIndex: | (int) | anIndex | ||
withObject: | (id) | anObject | ||
[implementation] |
- (void) replaceObjectsAtIndexes: | (CPIndexSet) | anIndexSet | ||
withObjects: | (CPArray) | objects | ||
[implementation] |
- (void) replaceObjectsInRange: | (CPRange) | aRange | ||
withObjectsFromArray: | (CPArray) | anArray | ||
[implementation] |
Replaces some of the receiver's objects with the objects from anArray
. Specifically, the elements of the receiver in the range specified by aRange
.
aRange | the range of elements to be replaced in the receiver | |
anArray | the array to retrieve objects for placement into the receiver |
- (void) replaceObjectsInRange: | (CPRange) | aRange | ||
withObjectsFromArray: | (CPArray) | anArray | ||
range: | (CPRange) | otherRange | ||
[implementation] |
Replaces some of the receiver's objects with objects from anArray
. Specifically, the elements of the receiver in the range specified by aRange
, with the elements of anArray
in the range specified by otherRange
.
aRange | the range of elements to be replaced in the receiver | |
anArray | the array to retrieve objects for placement into the receiver | |
otherRange | the range of objects in anArray to pull from for placement into the receiver |
- (CPEnumerator) reverseObjectEnumerator | [implementation] |
- (void) setArray: | (CPArray) | anArray | [implementation] |
- (void) setValue: | (id) | aValue | ||
forKey: | (CPString) | aKey | ||
[implementation] |
Sets the key-value for each element in the array.
aValue | the value for the coding | |
aKey | the key for the coding |
Definition at line 378 of file CPArray+KVO.j.
- (void) setValue: | (id) | aValue | ||
forKeyPath: | (CPString) | aKeyPath | ||
[implementation] |
Definition at line 387 of file CPArray+KVO.j.
- (CPArray) sortedArrayUsingFunction: | (Function) | aFunction | [implementation] |
- (CPArray) sortedArrayUsingFunction: | (Function) | aFunction | ||
context: | (id) | aContext | ||
[implementation] |
- (CPArray) sortedArrayUsingSelector: | (SEL) | aSelector | [implementation] |
- (void) sortUsingFunction: | (Function) | aFunction | ||
context: | (id) | aContext | ||
[implementation] |
- (void) sortUsingSelector: | (SEL) | aSelector | [implementation] |
- (CPArray) subarrayWithRange: | (CPRange) | aRange | [implementation] |
Returns the value for aKey
from each element in the array.
aKey | the key to return the value for |
Definition at line 304 of file CPArray+KVO.j.
- (id) valueForKeyPath: | (CPString) | aKeyPath | [implementation] |
Definition at line 337 of file CPArray+KVO.j.