API  1.0.0
CPMutableArray Class Reference

#import <CPMutableArray.h>

+ Inheritance diagram for CPMutableArray:

Instance Methods

(void) - addObject:
 
(void) - addObjectsFromArray:
 
(void) - exchangeObjectAtIndex:withObjectAtIndex:
 
(void) - insertObject:atIndex:
 
(CPUInteger) - 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

◆ addObject:()

- (void) addObject: (id)  anObject
implementation

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 41 of file CPMutableArray.j.

◆ addObjectsFromArray:()

- (void) addObjectsFromArray: (CPArray)  anArray
implementation

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 50 of file CPMutableArray.j.

◆ arrayWithCapacity:()

+ (CPArray) arrayWithCapacity: (CPUInteger)  aCapacity
implementation

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 22 of file CPMutableArray.j.

◆ exchangeObjectAtIndex:withObjectAtIndex:()

- (void) exchangeObjectAtIndex: (CPUInteger)  anIndex
withObjectAtIndex: (CPUInteger)  otherIndex 
implementation

Swaps the elements at the two specified indices.

Parameters
anIndexthe first index to swap from
otherIndexthe second index to swap from

Definition at line 323 of file CPMutableArray.j.

◆ insertObject:atIndex:()

- (void) insertObject: (id)  anObject
atIndex: (CPUInteger)  anIndex 
implementation

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 64 of file CPMutableArray.j.

◆ insertObject:inArraySortedByDescriptors:()

- (CPUInteger) insertObject: (id)  anObject
inArraySortedByDescriptors: (CPArray)  descriptors 
implementation

Definition at line 94 of file CPMutableArray.j.

◆ insertObjects:atIndexes:()

- (void) insertObjects: (CPArray)  objects
atIndexes: (CPIndexSet indexes 
implementation

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 74 of file CPMutableArray.j.

◆ removeAllObjects()

- (void) removeAllObjects
implementation

Removes all objects from this array.

Definition at line 199 of file CPMutableArray.j.

◆ removeLastObject()

- (void) removeLastObject
implementation

Removes the last object from the array.

Definition at line 208 of file CPMutableArray.j.

◆ removeObject:()

- (void) removeObject: (id)  anObject
implementation

Removes all entries of anObject from the array.

Parameters
anObjectthe object whose entries are to be removed

Definition at line 217 of file CPMutableArray.j.

◆ removeObject:inRange:()

- (void) removeObject: (id)  anObject
inRange: (CPRange)  aRange 
implementation

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 227 of file CPMutableArray.j.

◆ removeObjectAtIndex:()

- (void) removeObjectAtIndex: (CPUInteger)  anIndex
implementation

Removes the object at anIndex.

Parameters
anIndexthe location of the element to be removed

Definition at line 242 of file CPMutableArray.j.

◆ removeObjectIdenticalTo:()

- (void) removeObjectIdenticalTo: (id)  anObject
implementation

Remove all instances of anObject from the array. The search for the object is done using ==.

Parameters
anObjectthe object to remove

Definition at line 267 of file CPMutableArray.j.

◆ removeObjectIdenticalTo:inRange:()

- (void) removeObjectIdenticalTo: (id)  anObject
inRange: (CPRange)  aRange 
implementation

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 279 of file CPMutableArray.j.

◆ removeObjectsAtIndexes:()

- (void) removeObjectsAtIndexes: (CPIndexSet anIndexSet
implementation

Removes the objects at the indices specified by CPIndexSet.

Parameters
anIndexSetthe indices of the elements to be removed from the array

Definition at line 251 of file CPMutableArray.j.

◆ removeObjectsInArray:()

- (void) removeObjectsInArray: (CPArray)  anArray
implementation

Remove the objects in anArray from the receiver array.

Parameters
anArraythe array of objects to remove from the receiver

Definition at line 295 of file CPMutableArray.j.

◆ removeObjectsInRange:()

- (void) removeObjectsInRange: (CPRange)  aRange
implementation

Removes all the objects in the specified range from the receiver.

Parameters
aRangethe range of objects to remove

Definition at line 308 of file CPMutableArray.j.

◆ replaceObjectAtIndex:withObject:()

- (void) replaceObjectAtIndex: (CPUInteger)  anIndex
withObject: (id)  anObject 
implementation

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 127 of file CPMutableArray.j.

◆ replaceObjectsAtIndexes:withObjects:()

- (void) replaceObjectsAtIndexes: (CPIndexSet indexes
withObjects: (CPArray)  objects 
implementation

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 138 of file CPMutableArray.j.

◆ replaceObjectsInRange:withObjectsFromArray:()

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

Parameters
aRangethe range of elements to be replaced in the receiver
anArraythe array to retrieve objects for placement into the receiver

Definition at line 177 of file CPMutableArray.j.

◆ replaceObjectsInRange:withObjectsFromArray:range:()

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

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 158 of file CPMutableArray.j.

◆ setArray:()

- (void) setArray: (CPArray)  anArray
implementation

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 186 of file CPMutableArray.j.

◆ sortUsingDescriptors:()

- (void) sortUsingDescriptors: (CPArray)  descriptors
implementation

Definition at line 334 of file CPMutableArray.j.

◆ sortUsingFunction:context:()

- (void) sortUsingFunction: (Function)  aFunction
context: (id)  aContext 
implementation

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 353 of file CPMutableArray.j.

◆ sortUsingSelector:()

- (void) sortUsingSelector: (SEL)  aSelector
implementation

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 362 of file CPMutableArray.j.


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