API 0.9.5
CPMutableArray Class Reference

#import <CPMutableArray.h>

Inheritance diagram for CPMutableArray:

List of all members.

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:

Detailed Description

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.


Method Documentation

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

Parameters:
anObjectthe 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.

Parameters:
anArraythe 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.

Parameters:
anIndexthe first index to swap from
otherIndexthe 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.

Parameters:
anObjectthe object to insert into the array
anIndexthe 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.

Parameters:
objectsthe objects to add to this array
anIndexSetthe 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.

Parameters:
anObjectthe 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.

Parameters:
anObjectthe object to remove
aRangethe 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.

Parameters:
anIndexthe 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 ==.

Parameters:
anObjectthe 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 ==.

Parameters:
anObjectthe object to remove
aRangethe 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.

Parameters:
anIndexSetthe 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.

Parameters:
anArraythe 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.

Parameters:
aRangethe 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.

Parameters:
anIndexthe 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.

Parameters:
anIndexSetthe set of indices to array positions that will be replaced
objectsthe 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.

Parameters:
aRangethe range of elements to be replaced in the receiver
anArraythe 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.

Parameters:
aRangethe range of elements to be replaced in the receiver
anArraythe array to retrieve objects for placement into the receiver
otherRangethe 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.

Parameters:
anArraythe 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.

Parameters:
aFunctiona JavaScript function that will be called to compare objects
aContextan 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.

Parameters:
aSelectorthe selector for the method to call for comparison

Definition at line 393 of file CPMutableArray.j.


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