Array class.
More...
#import <SCArray.h>
Array class.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.3
Implements the array, which is a collection with the indexed access to the objects.
Class instances can thrown the following exceptions:
Returns an empty unnamed array created by using the default settings.
- Returns
- A created array
Reimplemented from SCCollection.
| + (instancetype) arrayWithArray: |
|
(SCArray *) |
array |
|
Returns an array created by using the specified existing array.
- Parameters
-
| array | - the existing source array |
- Returns
- A created array
- Exceptions
-
| + (instancetype) arrayWithAscendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Returns an ascending sorted array created by using the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A created array with the ascending sorted objects
- Exceptions
-
- See also
- + arrayWithSortedCollection:
Returns an ascending sorted array created by using the specified existing collection of any supported type and a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A created array with the ascending sorted objects
- Exceptions
-
- See also
- + arrayWithSortedCollection:sorter:
| + (instancetype) arrayWithCoder: |
|
(NSCoder *) |
coder |
|
Returns an array created by using the specified coder.
- Parameters
-
- Returns
- A created array
| + (instancetype) arrayWithCollection: |
|
(id<SCCollection>) |
collection |
|
Returns an array created by using the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A created array
- Exceptions
-
| + (instancetype) arrayWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns an array created by using the content of serialized file with the specified path.
- Parameters
-
| path | - the source serialized file path |
- Returns
- A created array
| + (instancetype) arrayWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns an array created by using the specified data dictionary.
- Parameters
-
| dictionary | - the source data dictionary |
- Returns
- A created array
| + (instancetype) arrayWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns an array created by using the data dictionary from the specified file.
- Parameters
-
| path | - the source data dictionary file path |
- Returns
- A created array
| + (instancetype) arrayWithDescendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a descending sorted array created by using the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A created array with the descending sorted objects
- Exceptions
-
Returns a descending sorted array created by using the specified existing collection of any supported type and a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A created array with the descending sorted objects
- Exceptions
-
| + (instancetype) arrayWithFileStream: |
|
(NSString *) |
path |
|
Returns an array created by using the data from the file stream with the specified path.
- Parameters
-
| path | - the path of the source file stream |
- Returns
- A created array
- Exceptions
-
| + (instancetype) arrayWithName: |
|
(NSString *) |
name |
|
Returns an empty array created by using the specified array name.
- Parameters
-
- Returns
- A created array
Returns an array created by using the specified existing object.
- Parameters
-
| object | - the existing source object |
- Returns
- A created array
- Exceptions
-
| + (instancetype) arrayWithObjects: |
|
(id<SCCollectioning>) |
object |
| , |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Returns an array created by using objects from the specified nil terminated list.
- Parameters
-
| object | - the first object |
| ... | - the other objects |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A created array
| + (instancetype) arrayWithSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Returns an ascending sorted array created by using the specified existing collection of any supported type.
- Parameters
-
| collection | -the existing source collection |
- Returns
- A created array with the ascending sorted objects
- Exceptions
-
- See also
- + arrayWithAscendingSortedCollection:
Returns an ascending sorted array created by using the specified existing collection of any supported type and a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A created array with the ascending sorted objects
- Exceptions
-
- See also
- + arrayWithAscendingSortedCollection:sorter:
| + (instancetype) arrayWithStream: |
|
(SCStream *) |
stream |
|
Returns an array created by using the data from the specified stream.
- Parameters
-
| stream | - the source stream |
- Returns
- A created array
- Exceptions
-
Returns an array with ascending sorted objects from the receiving array.
- Returns
- An array with sorted objects
- Exceptions
-
- See also
- Property sortedArray
Returns an array with objects from the receiving array that are ascending sorted by using the specified data sorter.
- Parameters
-
- Returns
- An array with sorted objects
- Exceptions
-
- See also
- - sortedArrayWithSorter:
| - (void) copyObjectAtIndex: |
|
(SCIndex) |
index |
| toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Copies the object at the specified source index to a given destination index.
- Parameters
-
| index | - the source index of the object to be copied |
| destination | - the destination index |
- Exceptions
-
| - (void) copyObjectsInRange: |
|
(NSRange) |
range |
| toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Copies the objects in the specified range to a given destination index.
- Parameters
-
| range | - the range of the objects to be copied |
| destination | - the destination index |
- Exceptions
-
| - (SCArray *) descendingSortedArray |
|
|
|
Returns an array with descending sorted objects from the receiving array.
- Returns
- An array with sorted objects
- Exceptions
-
Returns an array with objects from the receiving array that are descending sorted by using the specified data sorter.
- Parameters
-
- Returns
- An array with sorted objects
- Exceptions
-
Duplicates the content of the receiving array.
- Exceptions
-
| - (void) duplicateAllObjects |
|
|
|
Duplicates the all objects within the receiving array.
- Exceptions
-
| - (void) duplicateObjectAtIndex: |
|
(SCIndex) |
index |
|
Duplicates the object at the specified index.
- Parameters
-
| index | - the index of the object to be duplicate |
- Exceptions
-
| - (void) duplicateObjectsInRange: |
|
(NSRange) |
range |
|
Duplicates the objects within the specified range.
- Parameters
-
| range | - the range of the objects to be duplicate |
- Exceptions
-
| - (void) exchangeObjectAtIndex: |
|
(SCIndex) |
index |
| withObjectAtIndex: |
|
(SCIndex) |
destination |
|
|
| |
Exchanges the objects in the receiving array at given indexes.
- Parameters
-
| index | - the index of the first object |
| destination | - the index of the second object |
- Exceptions
-
Returns the lowest index whose corresponding receiving array object is equal to a given object.
- Parameters
-
| object | - еру desired object |
- Returns
- Lowest index of object that equals to the specified object, otherwise SCNotFound
Reimplemented from <SCIndexedCollection>.
Returns the lowest index within a specified range whose corresponding receiving array object is equal to a given object.
- Parameters
-
| object | - the desired object |
| range | - the range of indexes in the array within which to search for the specified object |
- Returns
- Lowest index within range of the object that equals to the specified object, otherwise NO
- Exceptions
-
Initializes an empty unnamed array using the default settings.
- Returns
- A newly initialized array
| - (instancetype) initWithArray: |
|
(SCArray *) |
array |
|
Initializes an array using the specified existing array.
- Attention
- Designed initializer
- Parameters
-
| array | - the existing source array |
- Returns
- A newly initialized array
- Exceptions
-
| - (instancetype) initWithAscendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes an array using the ascending sorted content from the specified existing collection.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A newly initialized array with the ascending sorted objects
- Exceptions
-
- See also
- - initWithSortedCollection:
Initializes an array using the ascending sorted content from the specified existing collection and a given sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A newly initialized array with the ascending sorted objects
- Exceptions
-
- See also
- - initWithSortedCollection:sorter:
| - (instancetype) initWithCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes an array using the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A newly initialized array
- Exceptions
-
Reimplemented from SCCollection.
| - (instancetype) initWithDescendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes an array using the descending sorted content from the specified existing collection.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A newly initialized array with the descending sorted objects
- Exceptions
-
Initializes an array using the descending sorted content from the specified existing collection and a given sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A newly initialized array with the descending sorted objects
- Exceptions
-
| - (instancetype) initWithName: |
|
(NSString *) |
name |
|
Initializes an empty array using the specified array name.
- Attention
- Designed initializer
- Parameters
-
- Returns
- A newly initialized array
Initializes an array using the specified existing object.
- Parameters
-
| object | - the existing source object |
- Returns
- A newly initialized array
- Exceptions
-
| - (instancetype) initWithObjects: |
|
(id<SCCollectioning>) |
object |
| , |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Initializes an array using the existing objects from the specified nil terminated list.
- Parameters
-
| object | - the first source object |
| ... | - the other source objects |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A newly initialized array
| - (instancetype) initWithSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes an array using the ascending sorted content from the specified existing collection.
- Parameters
-
| collection | - the existing source collection |
- Returns
- A newly initialized array with the ascending sorted objects
- Exceptions
-
- See also
- - initWithAscendingSortedCollection:
Initializes an array using the ascending sorted content from the specified existing collection and a given sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Returns
- A newly initialized array with the ascending sorted objects
- Exceptions
-
- See also
- - initWithAscendingSortedCollection:sorter:
Inserts the objects from the specified nil terminated list into the receiving array at a given index.
- Parameters
-
| index | - the index at which to insert objects |
| object | - the first inserting object |
| ... | - the other inserting objects |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
| - (void) insertAtIndexes: |
|
(NSIndexSet *) |
indexes |
| objects: |
|
(id<SCCollectioning>) |
object |
| , |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Inserts the objects from the specified nil terminated list into the receiving array at a given indexes.
- Parameters
-
| indexes | - the indexes at which the objects should be inserted |
| object | - the first object to insert into the receiving array |
| ... | - the other inserting objects |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
Inserts the objects from the specified collection of any supported type into the receiving array at a given index.
- Parameters
-
| collection | - the collection of objects to insert into the receiving array at the specified index |
| index | - the index at which to insert objects from the specified collection |
- Exceptions
-
| - (void) insertCollection: |
|
(id<SCCollection>) |
collection |
| atIndexes: |
|
(NSIndexSet *) |
indexes |
|
|
| |
Inserts the objects from the provided collection of any supported type into the receiving array at the specified indexes.
- Parameters
-
| collection | - the collection of objects to insert into the receiving array |
| indexes | - the indexes at which the objects should be inserted |
- Exceptions
-
Inserts into the receiving array the specified existing object at a given index.
- Parameters
-
| object | - the inserting existing object |
| index | - the index at which to insert object |
- Exceptions
-
Reimplemented from <SCMutableIndexedCollection>.
| - (BOOL) isEqualToArray: |
|
(SCArray *) |
array |
|
Returns a boolean value that indicates whether the content and settings of the receiving array are equal to the content and settings of another given array.
- Parameters
-
| array | - the array with which to compare the receiving array |
- Returns
- YES if the content and settings of other array are equal to the content and settings of the receiving array, otherwise NO
| - (BOOL) isEqualToContentsOfArray: |
|
(SCArray *) |
array |
|
Returns a boolean value that indicates whether the content of the receiving array is equals to the content of another given array.
- Parameters
-
| array | - the array with which to compare the receiving array |
- Returns
- YES if the content of other array is equals to the content of the receiving array, otherwise NO
| - (void) moveObjectAtIndex: |
|
(SCIndex) |
index |
| toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Moves the object ath the specified source index to a given destination index.
- Parameters
-
| index | - the source index of the object to be move |
| destination | - the destination index |
- Exceptions
-
| - (void) moveObjectsInRange: |
|
(NSRange) |
range |
| toIndex: |
|
(SCIndex) |
destination |
|
|
| |
Moves the objects in the specified range to a given destination index.
- Parameters
-
| range | - the range of the objects to be move |
| destination | - the destination index |
- Exceptions
-
| - (id) objectAtIndex: |
|
(SCIndex) |
index |
|
Returns the object located at the specified index.
- Parameters
-
| index | - the index within the bounds of the array |
- Returns
- The object located at the specified index
- Exceptions
-
Reimplemented from <SCIndexedCollection>.
| - (SCArray *) objectsAtIndexes: |
|
(NSIndexSet *) |
indexes |
|
Returns an array containing the objects in the receving array at the indexes specified by a given index set.
- Parameters
-
| indexes | - the index set with indexes of the required objects |
- Returns
- Array with the required objects
- Exceptions
-
| - (SCArray *) objectsInRange: |
|
(NSRange) |
range |
|
Returns an array containg the objects in the receiving array in the specified range.
- Parameters
-
| range | - the range of the requited objects |
- Returns
- Array with the objecst in the specified range
- Exceptions
-
| - (void) removeFirstObject |
|
|
|
Removes the first object from the receiving array.
- Exceptions
-
| - (void) removeLastObject |
|
|
|
Removes the object with the highest-valued index in the receiving array.
- Exceptions
-
| - (void) removeObjectAtIndex: |
|
(SCIndex) |
index |
|
Removes from the receiving array the object at the specified index.
- Parameters
-
| index | - the index from which to remove the object in the array |
- Exceptions
-
Reimplemented from <SCMutableIndexedCollection>.
| - (void) removeObjectsAtIndexes: |
|
(NSIndexSet *) |
indexes |
|
Removes the objects at the specified indexes from the receiving array.
- Parameters
-
| indexes | - the indexes of the objects to remove from the array |
- Exceptions
-
Reimplemented from <SCMutableIndexedCollection>.
| - (void) removeObjectsInRange: |
|
(NSRange) |
range |
|
Removes from the receiving array each of the objects within a given range.
- Parameters
-
| range | - the range of objects to be removed from the array |
- Exceptions
-
Replaces the object at the specified index with a given object.
- Parameters
-
| index | - the index of the object to be replaced |
| object | - the object with which to replace the object at the specified index |
- Exceptions
-
Reimplemented from <SCMutableIndexedCollection>.
| - (void) replaceObjectsAtIndexes: |
|
(NSIndexSet *) |
indexes |
| withCollection: |
|
(id<SCCollection>) |
collection |
|
|
| |
Replaces the objects in the receiving array at the specified indexes with the objects from a given collection of any supported type.
- Parameters
-
| indexes | - the indexes of the objects to be replaced |
| collection | - the collection with the objects with which to replace the objects in the receiving array |
- Exceptions
-
| - (void) replaceObjectsAtIndexes: |
|
(NSIndexSet *) |
indexes |
| withObjects: |
|
(id<SCCollectioning>) |
object |
| , |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Replaces the objects in the receiving array at locations specified with the objects from a given nil teminated list.
- Parameters
-
| indexes | - the indexes of the objects to be replaced |
| object | - the first object with which to replace the objects in the receiving array |
| ... | - other objects with which to replace the objects in the receiving array |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
| - (void) replaceObjectsInRange: |
|
(NSRange) |
range |
| withCollection: |
|
(id<SCCollection>) |
collection |
|
|
| |
Replaces the objects in the receiving array specified by a given range with the objects from a given collection of any supported type.
- Parameters
-
| range | - the range of objects to be replaced in (or removed from) the receiving array |
| collection | - the collection of objects from which to select replacements for the objects in the specified range |
- Exceptions
-
| - (void) replaceObjectsInRange: |
|
(NSRange) |
range |
| withObjects: |
|
(id<SCCollectioning>) |
object |
| , |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Replaces the objects in the receiving array specified by a given range with the objects from a given nil terminated list.
- Parameters
-
| range | - the range of objects to be replaced in (or removed from) the receiving array |
| object | - the first object with which to replace the objects in the receiving array |
| ... | - other objects with which to replace the objects in the receiving array |
| NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
Reverses the order of all objects in the receiving array.
- Exceptions
-
| - (void) setArray: |
|
(SCArray *) |
array |
|
Replaces the content and settings of the receiving array by using the content and settings from the specified existing array.
- Parameters
-
| array | - the existing source array |
- Exceptions
-
| - (void) setAscendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Replaces the settings and content of the receiving array by using the settings and ascending sorted content of the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Exceptions
-
- See also
- - setSortedCollection:
Replaces the settings and content of the receiving array by using the settings and ascending sorted content of the specified existing source collection of any supported type with a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Exceptions
-
- See also
- - setSortedCollection:sorter:
| - (void) setDescendingSortedCollection: |
|
(id<SCCollection>) |
collection |
|
Replaces the settings and content of the receiving array by using the settings and descending sorted content of the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Exceptions
-
Replaces the settings and content of the receiving array by using the settings and descending sorted content of the specified existing source collection of any supported type with a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Exceptions
-
Replaces the object at the specified index with the new object, possibly adding the object.
- Parameters
-
| object | - the object with which to replace the object at the specified index |
| index | - the index of the object to be replaced |
- Exceptions
-
Replaces the settings and content of the receiving array by using the settings and ascending sorted content of the specified existing collection of any supported type.
- Parameters
-
| collection | - the existing source collection |
- Exceptions
-
- See also
- - setAscendingSortedCollection:
Replaces the settings and content of the receiving array by using the settings and ascending sorted content of the specified existing collection of any supported type with a given data sorter.
- Parameters
-
| collection | - the existing source collection |
| sorter | - the data sorter |
- Exceptions
-
- See also
- - setAscendingSortedCollection:sorter:
Sorts ascending the receiving array using the default data sorter.
- Exceptions
-
- See also
- - sortAscending
Sorts ascending the receiving array using the default data sorter.
- Exceptions
-
- See also
- - sort
| - (void) sortAscendingWithSorter: |
|
(id<SCSorter>) |
sorter |
|
Sorts ascending the receiving array using the specified data sorter.
- Parameters
-
- Exceptions
-
- See also
- - sortWithSorter:
Sorts descending the receiving array using the default data sorter.
- Exceptions
-
| - (void) sortDescendingWithSorter: |
|
(id<SCSorter>) |
sorter |
|
Sorts descending the receiving array using the specified data sorter.
- Parameters
-
- Exceptions
-
Returns an array with objects from the receiving array that are ascending sorted by using the specified data sorter.
- Parameters
-
- Returns
- An array with sorted objects
- Exceptions
-
- See also
- - ascendingSortedArrayWithSorter:
| - (void) sortWithSorter: |
|
(id<SCSorter>) |
sorter |
|
Index of the array last object
Array with objects in reverse order
Array with ascending sorted objects
The documentation for this class was generated from the following files: