Samond Classes Library 1.2.1-RELEASE build 181
List of all members
NSArray(SCArray) Category Reference

Standard class NSArray functionality extending category. More...

#import <NSArray+SCArray.h>

Inheritance diagram for NSArray(SCArray):
<SCCollection> <SCIndexedCollection> <SCCollection>

Creating Arrays

(instancetype) + arrayWithCoder:
 
(instancetype) + arrayWithContentsOfSerializedFile:
 
(instancetype) + arrayWithDataDictionary:
 
(instancetype) + arrayWithDataDictionaryFromFile:
 
(instancetype) + arrayWithStream:
 
(instancetype) + arrayWithFileStream:
 
(instancetype) + arrayWithAscendingSortedCollection:sorter:
 
(instancetype) + arrayWithDescendingSortedCollection:sorter:
 
(instancetype) + arrayWithSortedCollection:sorter:
 
(instancetype) + arrayWithAscendingSortedCollection:
 
(instancetype) + arrayWithDescendingSortedCollection:
 
(instancetype) + arrayWithSortedCollection:
 
(instancetype) + arrayWithCollection:
 

Initializing Arrays

(instancetype) - initWithAscendingSortedCollection:sorter:
 
(instancetype) - initWithDescendingSortedCollection:sorter:
 
(instancetype) - initWithSortedCollection:sorter:
 
(instancetype) - initWithAscendingSortedCollection:
 
(instancetype) - initWithDescendingSortedCollection:
 
(instancetype) - initWithSortedCollection:
 
(instancetype) - initWithCollection:
 

Protocol SCCollection Implementation

BOOL empty
 
BOOL readOnly
 
(BOOL) - isCollection
 
(BOOL) - isLibraryCollection
 
(BOOL) - isFoundationCollection
 
(BOOL) - isArray
 
(BOOL) - isLibraryArray
 
(BOOL) - isFoundationArray
 
(BOOL) - isSet
 
(BOOL) - isLibrarySet
 
(BOOL) - isFoundationSet
 
(BOOL) - isOrderedSet
 
(BOOL) - isLibraryOrderedSet
 
(BOOL) - isFoundationOrderedSet
 
(BOOL) - isDictionary
 
(BOOL) - isLibraryDictionary
 
(BOOL) - isFoundationDictionary
 
(BOOL) - isStack
 
(BOOL) - isQueue
 
(BOOL) - isList
 
(BOOL) - isSortable
 

Finding Objects in an Array

(BOOL) - containsObjects:
 
(BOOL) - containsCollection:
 
(BOOL) - containsAnyObject:
 
(BOOL) - containsAnyObjectFromCollection:
 
(SCIndex- indexOfLastObject
 

Converting Arrays

SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
NSArray * reversedArray
 

Sorting Arrays

NSArray * sortedArray
 
(NSArray *) - ascendingSortedArrayWithSorter:
 
(NSArray *) - descendingSortedArrayWithSorter:
 
(NSArray *) - sortedArrayWithSorter:
 
(NSArray *) - ascendingSortedArray
 
(NSArray *) - descendingSortedArray
 

Additional Inherited Members

- Instance Methods inherited from <SCCollection>
(NSString *) - name
 
(void) - setName:
 
(SCIndex- count
 
(BOOL) - containsObject:
 
(NSEnumerator *) - objectEnumerator
 
(NSEnumerator *) - reverseObjectEnumerator
 
- Instance Methods inherited from <SCIndexedCollection>
(id) - firstObject
 
(id) - lastObject
 
(id) - objectAtIndex:
 
(SCIndex- indexOfObject:
 
- Properties inherited from <SCCollection>
NSString * name
 
SCIndex count
 
BOOL empty
 
NSString * description
 
SCArrayarray
 
SCSetset
 
SCOrderedSetorderedSet
 
SCDictionarydictionary
 
SCStackstack
 
SCQueuequeue
 
SCUnidirectionalListunidirectionalList
 
SCBidirectionalListbidirectionalList
 
NSArray * foundationArray
 
NSSet * foundationSet
 
NSOrderedSet * foundationOrderedSet
 
NSDictionary * foundationDictionary
 
NSEnumerator * objectEnumerator
 

Detailed Description

Standard class NSArray functionality extending category.

SDK
macOS 10.6+, iOS 7.0+, GNUstep
Since
version 1.1.3

Implements the additional methods for add into the standard class NSArray the enhanced functionality.

Method Documentation

+ (instancetype) arrayWithAscendingSortedCollection: (id<SCCollection>)  collection

Returns an ascending sorted array created by using the specified existing collection of any supported type.

Parameters
collection- the source collection
Returns
A created array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
+ arrayWithSortedCollection:
+ (instancetype) arrayWithAscendingSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Returns an ascending sorted array created by using the specified existing collection of any supported type and a given data sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A created array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
+ arrayWithSortedCollection:sorter:
+ (instancetype) arrayWithCoder: (NSCoder *)  coder

Returns an array created by using the specified coder.

Parameters
coder- the source coder
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 source collection
Returns
A created array
Exceptions
SCCollectionException- collection error detected
+ (instancetype) arrayWithContentsOfSerializedFile: (NSString *)  path

Returns an array created by using the content of serialized file with the specified path.

Parameters
path- the path to the source serialized file
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 path to the source file with the data dictionary
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 source collection
Returns
A created array with the descending sorted objects
Exceptions
SCCollectionException- collection error detected
+ (instancetype) arrayWithDescendingSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Returns a descending sorted array created by using the specified existing collection of any supported type and a given data sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A created array with the descending sorted objects
Exceptions
SCCollectionException- collection error detected
+ (instancetype) arrayWithFileStream: (NSString *)  path

Returns an array created by using the data from the file stream with the specified path.

Parameters
path- the path to the source file stream
Returns
A created array
Exceptions
SCStreamException- stream error detected
SCSystemException- system error detected
+ (instancetype) arrayWithSortedCollection: (id<SCCollection>)  collection

Returns an ascending sorted array created by using the specified existing collection of any supported type.

Parameters
collection- the source collection
Returns
A created array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
+ arrayWithAscendingSortedCollection:
+ (instancetype) arrayWithSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Returns an ascending sorted array created by using the specified existing collection of any supported type and a given data sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A created array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
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
SCStreamException- stream error detected
SCSystemException- system error detected
- (NSArray *) ascendingSortedArray

Returns an array with ascending sorted objects from the receiving array.

Returns
An array with the sorted objects
Exceptions
SCCollectionException- collection error detected
See also
sortedArray
- (NSArray *) ascendingSortedArrayWithSorter: (id<SCSorter>)  sorter

Returns an array with objects from the receiving array that are ascending sorted by using the specified data sorter.

Parameters
sorter- the data sorter
Returns
An array with the sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- sortedArrayWithSorter:
- (BOOL) containsAnyObject: (id<SCCollectioning>)  object
,   NS_REQUIRES_NIL_TERMINATION 

Returns a boolean value that indicates whether the receiving array contains at least one object from the specified list.

Parameters
object- the first object to find within the receiving array
...- a comma-separated list of additional objects, ending with nil pointer
NS_REQUIRES_NIL_TERMINATION- a mandatory nil pointer
Returns
YES if the receiving array contains at least one object from the list, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) containsAnyObjectFromCollection: (id<SCCollection>)  collection

Returns a boolean value that indicates whether the receiving array contains at least one object from the specified collection of any supported type.

Parameters
collection- the collection with the required objects
Returns
YES if the receiving array contains at least one object from the specified collection, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) containsCollection: (id<SCCollection>)  collection

Returns a boolean value that indicates whether the receiving array contains all objects from the specified collection of any supported type.

Parameters
collection- the collection with the required objects
Returns
YES if the all required objects are present in the receiving array, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) containsObjects: (id<SCCollectioning>)  object
,   NS_REQUIRES_NIL_TERMINATION 

Returns a boolean value that indicates whether the receiving array contains all objects from the specified list.

Parameters
object- the first object to find within the receiving array
...- a comma-separated list of additional objects, ending with nil pointer
NS_REQUIRES_NIL_TERMINATION- a mandatory nil pointer
Returns
YES if all objects are present in the receiving array, otherwise NO

Reimplemented from <SCCollection>.

- (NSArray *) descendingSortedArray

Returns an array with descending sorted objects from the receiving array.

Returns
An array with the sorted objects
Exceptions
SCCollectionException- collection error detected
- (NSArray *) descendingSortedArrayWithSorter: (id<SCSorter>)  sorter

Returns an array with objects from the receiving array that are descending sorted by using the specified data sorter.

Parameters
sorter- the data sorter
Returns
An array with the sorted objects
Exceptions
SCCollectionException- collection error detected
- (SCIndex) indexOfLastObject

Returns an index of the array last object.

Returns
An index of the last object within the array

Reimplemented from <SCIndexedCollection>.

- (instancetype) initWithAscendingSortedCollection: (id<SCCollection>)  collection

Initializes an array using the ascending sorted content from the specified existing collection.

Parameters
collection- the source collection
Returns
A newly initialized array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- initWithSortedCollection:
- (instancetype) initWithAscendingSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Initializes an array using the ascending sorted content from the specified existing collection and a given sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A newly initialized array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- initWithSortedCollection:sorter:
- (instancetype) initWithCollection: (id<SCCollection>)  collection

Initializes an array using the specified existing collection of any supported type.

Parameters
collection- the source collection
Returns
A newly initialized array
Exceptions
SCCollectionException- collection error detected

Reimplemented from <SCCollection>.

- (instancetype) initWithDescendingSortedCollection: (id<SCCollection>)  collection

Initializes an array using the descending sorted content from the specified existing collection.

Parameters
collection- the source collection
Returns
A newly initialized array with the descending sorted objects
Exceptions
SCCollectionException- collection error detected
- (instancetype) initWithDescendingSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Initializes an array using the descending sorted content from the specified existing collection and a given sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A newly initialized array with the descending sorted objects
Exceptions
SCCollectionException- collection error detected
- (instancetype) initWithSortedCollection: (id<SCCollection>)  collection

Initializes an array using the ascending sorted content from the specified existing collection.

Parameters
collection- the source collection
Returns
A newly initialized array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- initWithAscendingSortedCollection:
- (instancetype) initWithSortedCollection: (id<SCCollection>)  collection
sorter: (id<SCSorter>)  sorter 

Initializes an array using the ascending sorted content from the specified existing collection and a given sorter.

Parameters
collection- the source collection
sorter- the data sorter
Returns
A newly initialized array with the ascending sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- initWithAscendingSortedCollection:sorter:
- (BOOL) isArray

Returns a boolean value that indicates whether the receiving instance is an array of any supported type.

Returns
YES if the receiving instance is an array, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isCollection

Returns a boolean value that indicates whether the receiving instance is a collection of any supported type.

Returns
YES if the receiving instance is a collection, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isDictionary

Returns a boolean value that indicates whether the receiving instance is a dictionary of any supported type.

Returns
YES if the receiving instance is a dictionary, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isFoundationArray

Returns a boolean value that indicates whether the reciving instance is a standard array.

Returns
YES if the receiving instance is a standard array, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isFoundationCollection

Returns a boolean value that indicates whether the receiving instance is a standard collection.

Returns
YES if the receiving instance is a library collection, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isFoundationDictionary

Returns a boolean value that indicates whether the receiving instance is a standard dictionary.

Returns
YES if the receiving instance is a standard dictionary, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isFoundationOrderedSet

Returns a boolean value that indicates whether the receiving instance is a standard ordered set.

Returns
YES if the receiving instance is a standard ordered set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isFoundationSet

Returns a boolean value that indicates whether the receiving instance is a standard set.

Returns
YES if the receiving instance is a standard set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isLibraryArray

Returns a boolean value that indicates whether the receiving instance is a library array.

Returns
YES if the receiving instance is a library array, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isLibraryCollection

Returns a boolean value that indicates whether the receiving instance is a library collection.

Returns
YES if the receiving instance is a library collection, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isLibraryDictionary

Returns a boolean value that indicates whether the receiving instance is a library dictionary.

Returns
YES if the receiving instance is a library dictionary, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isLibraryOrderedSet

Returns a boolean value that indicates whether the receiving instance is a library ordered set.

Returns
YES if the receiving instance is a library ordered set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isLibrarySet

Returns a boolean value that indicates whether the receiving instance is a library set.

Returns
YES if the receiving instance is a library set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isList

Returns a boolean value that indicates whether the receiving instance is a list of any supported type.

Returns
YES if the receiving instance is a list, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isOrderedSet

Returns a boolean value that indicates whether the receiving instance is an ordered set of any supported type.

Returns
YES if the receiving instance is an orderder set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isQueue

Returns a boolean value that indicates whether the receiving instance is a queue.

Returns
YES if the receiving instance is a queue, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isSet

Returns a boolean value that indicates whether the receiving instance is a set of any supported type.

Returns
YES if the receiving instance is a set, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isSortable

Returns a boolean value that indicates whether the receiving instance is a sortable collection of any supported type.

Returns
YES if the receiving instance is a sortable collection, otherwise NO

Reimplemented from <SCCollection>.

- (BOOL) isStack

Returns a boolean value that indicates whether the receiving instance is a stack.

Returns
YES if the receiving instance is a stack, otherwise NO

Reimplemented from <SCCollection>.

- (NSArray *) sortedArrayWithSorter: (id<SCSorter>)  sorter

Returns an array with objects from the receiving array that are ascending sorted by using the specified data sorter.

Parameters
sorter- the data sorter
Returns
An array with the sorted objects
Exceptions
SCCollectionException- collection error detected
See also
- ascendingSortedArrayWithSorter:

Property Documentation

- (SCArray *) array
readnonatomicretain

An array with the all objects from the receiving array

- (SCBidirectionalList *) bidirectionalList
readnonatomicretain

A bidirectional list with the all objects from the receiving array

- (SCDictionary *) dictionary
readnonatomicretain

A dictionary with the all objects from the receiving array

- (BOOL) empty
readnonatomicassign

Determines whether the array is empty or contains at least one object

- (NSArray *) foundationArray
readnonatomicretain

A foundation array with the all objects from the receiving array

- (NSDictionary *) foundationDictionary
readnonatomicretain

A foundation dictionary with all objects from the receiving array

- (NSOrderedSet *) foundationOrderedSet
readnonatomicretain

A foundation ordered set with the all objects from the receiving array

SDK
macOS 10.7+, iOS 7.0+
- (NSSet *) foundationSet
readnonatomicretain

A foundation set with the all objects from the receiving array

- (SCOrderedSet *) orderedSet
readnonatomicretain

An ordered set with the all objects from the receiving array

SDK
macOS 10.7+, iOS 7.0+
- (SCQueue *) queue
readnonatomicretain

A queue with the all objects from the receiving array

- (BOOL) readOnly
readnonatomicassign

Determines whether the array is in read only mode

- (NSArray *) reversedArray
readnonatomicretain

An array with objects in the reversed order

- (SCSet *) set
readnonatomicretain

A set with the all objects from the receiving array

- (NSArray *) sortedArray
readnonatomicretain

An array with the ascending sorted objects

- (SCStack *) stack
readnonatomicretain

A stack with the all objects from the receiving array

- (SCUnidirectionalList *) unidirectionalList
readnonatomicretain

An unidirectional list with the all objects from the receiving array


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