![]() |
API 0.9.5
|
#import <CPMutableArray.h>
Instance Methods | |
(void) | - addObject: |
(void) | - addObjectsFromArray: |
(void) | - exchangeObjectAtIndex:withObjectAtIndex: |
(void) | - insertObject:atIndex: |
(unsigned) | - insertObject:inArraySortedByDescriptors: |
(void) | - insertObjects:atIndexes: |
(void) | - removeAllObjects |
(void) | - removeLastObject |
(void) | - removeObject: |
(void) | - removeObject:inRange: |
(void) | - removeObjectAtIndex: |
(void) | - removeObjectIdenticalTo: |
(void) | - removeObjectIdenticalTo:inRange: |
(void) | - removeObjectsAtIndexes: |
(void) | - removeObjectsInArray: |
(void) | - removeObjectsInRange: |
(void) | - replaceObjectAtIndex:withObject: |
(void) | - replaceObjectsAtIndexes:withObjects: |
(void) | - replaceObjectsInRange:withObjectsFromArray: |
(void) | - replaceObjectsInRange:withObjectsFromArray:range: |
(void) | - setArray: |
(void) | - sortUsingDescriptors: |
(void) | - sortUsingFunction:context: |
(void) | - sortUsingSelector: |
Class Methods | |
(CPArray) | + arrayWithCapacity: |
This class is just an empty subclass of CPArray. CPArray already implements mutable methods and this class only exists for source compatability.
Definition at line 2 of file CPMutableArray.h.
- (void) addObject: | (id) | anObject |
Initializes an array able to store at least aCapacity
items. Because CPArray is backed by JavaScript arrays, this method ends up simply returning a regular array.
Adds anObject
to the end of the array.
anObject | the object to add to the array |
Definition at line 42 of file CPMutableArray.j.
- (void) addObjectsFromArray: | (CPArray) | anArray |
Adds the objects in anArray
to the receiver array.
anArray | the array of objects to add to the end of the receiver |
Definition at line 51 of file CPMutableArray.j.
+ (CPArray) arrayWithCapacity: | (unsigned) | aCapacity |
Creates an array able to store at least aCapacity
items. Because CPArray is backed by JavaScript arrays, this method ends up simply returning a regular array.
Definition at line 23 of file CPMutableArray.j.
- (void) exchangeObjectAtIndex: | (unsigned) | anIndex | |
withObjectAtIndex: | (unsigned) | otherIndex | |
Swaps the elements at the two specified indices.
anIndex | the first index to swap from |
otherIndex | the second index to swap from |
Definition at line 324 of file CPMutableArray.j.
- (void) insertObject: | (id) | anObject | |
atIndex: | (int) | anIndex | |
Inserts an object into the receiver at the specified location.
anObject | the object to insert into the array |
anIndex | the location to insert anObject at |
Definition at line 65 of file CPMutableArray.j.
- (unsigned) insertObject: | (id) | anObject | |
inArraySortedByDescriptors: | (CPArray) | descriptors | |
Definition at line 95 of file CPMutableArray.j.
- (void) insertObjects: | (CPArray) | objects | |
atIndexes: | (CPIndexSet) | indexes | |
Inserts the objects in the provided array into the receiver at the indexes specified.
objects | the objects to add to this array |
anIndexSet | the indices for the objects |
Definition at line 75 of file CPMutableArray.j.
- (void) removeAllObjects |
Removes all objects from this array.
Definition at line 200 of file CPMutableArray.j.
- (void) removeLastObject |
Removes the last object from the array.
Definition at line 209 of file CPMutableArray.j.
- (void) removeObject: | (id) | anObject |
Removes all entries of anObject
from the array.
anObject | the object whose entries are to be removed |
Definition at line 218 of file CPMutableArray.j.
- (void) removeObject: | (id) | anObject | |
inRange: | (CPRange) | aRange | |
Removes all entries of anObject
from the array, in the range specified by aRange
.
anObject | the object to remove |
aRange | the range to search in the receiver for the object |
Definition at line 228 of file CPMutableArray.j.
- (void) removeObjectAtIndex: | (int) | anIndex |
Removes the object at anIndex
.
anIndex | the location of the element to be removed |
Definition at line 243 of file CPMutableArray.j.
- (void) removeObjectIdenticalTo: | (id) | anObject |
Remove the first instance of anObject
from the array. The search for the object is done using ==
.
anObject | the object to remove |
Definition at line 268 of file CPMutableArray.j.
- (void) removeObjectIdenticalTo: | (id) | anObject | |
inRange: | (CPRange) | aRange | |
Remove the first instance of anObject
from the array, within the range specified by aRange
. The search for the object is done using ==
.
anObject | the object to remove |
aRange | the range in the array to search for the object |
Definition at line 280 of file CPMutableArray.j.
- (void) removeObjectsAtIndexes: | (CPIndexSet) | anIndexSet |
Removes the objects at the indices specified by CPIndexSet
.
anIndexSet | the indices of the elements to be removed from the array |
Definition at line 252 of file CPMutableArray.j.
- (void) removeObjectsInArray: | (CPArray) | anArray |
Remove the objects in anArray
from the receiver array.
anArray | the array of objects to remove from the receiver |
Definition at line 296 of file CPMutableArray.j.
- (void) removeObjectsInRange: | (CPRange) | aRange |
Removes all the objects in the specified range from the receiver.
aRange | the range of objects to remove |
Definition at line 309 of file CPMutableArray.j.
- (void) replaceObjectAtIndex: | (int) | anIndex | |
withObject: | (id) | anObject | |
Replaces the element at anIndex
with anObject
. The current element at position anIndex
will be removed from the array.
anIndex | the position in the array to place anObject |
Definition at line 128 of file CPMutableArray.j.
- (void) replaceObjectsAtIndexes: | (CPIndexSet) | indexes | |
withObjects: | (CPArray) | objects | |
Replace the elements at the indices specified by anIndexSet
with the objects in objects
.
anIndexSet | the set of indices to array positions that will be replaced |
objects | the array of objects to place in the specified indices |
Definition at line 139 of file CPMutableArray.j.
- (void) replaceObjectsInRange: | (CPRange) | aRange | |
withObjectsFromArray: | (CPArray) | anArray | |
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 |
Definition at line 178 of file CPMutableArray.j.
- (void) replaceObjectsInRange: | (CPRange) | aRange | |
withObjectsFromArray: | (CPArray) | anArray | |
range: | (CPRange) | otherRange | |
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 |
Definition at line 159 of file CPMutableArray.j.
- (void) setArray: | (CPArray) | anArray |
Sets the contents of the receiver to be identical to the contents of anArray
.
anArray | the array of objects used to replace the receiver's objects |
Definition at line 187 of file CPMutableArray.j.
- (void) sortUsingDescriptors: | (CPArray) | descriptors |
Definition at line 335 of file CPMutableArray.j.
- (void) sortUsingFunction: | (Function) | aFunction | |
context: | (id) | aContext | |
Sorts the receiver array using a JavaScript function as a comparator, and a specified context.
aFunction | a JavaScript function that will be called to compare objects |
aContext | an object that will be passed to aFunction with comparison |
Definition at line 345 of file CPMutableArray.j.
- (void) sortUsingSelector: | (SEL) | aSelector |
Sorts the receiver array using an Objective-J method as a comparator.
aSelector | the selector for the method to call for comparison |
Definition at line 393 of file CPMutableArray.j.