Samond Classes Library 1.1.6-RELEASE build 132

NSArray(SCNSArray) Category Reference

Additional functionality for class NSArray. More...

#import <SCNSArray.h>

List of all members.

Public Member Functions

Supporting Data Dictionaries
(void) - writeToDataDictionary:
(void) - writeToDataDictionaryFile:atomically:
(void) - writeToDataDictionaryFile:
(NSDictionary *) - dataDictionary
Supporting Coders and Serialized Files
(BOOL) - writeContentsToSerializedFile:
Supporting Collections
(id< SCCollectionProtocol >) - copyObject
(SCComparisonResult- compareWithObject:
Supporting Streams
(void) - writeToStream:
(void) - writeToFileStream:
(void) - appendToFileStream:
Other Methods
(NSString *) - className
Detecting Collection Type
(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
Sorting Array
(NSArray *) - sortedArrayAscendingWithMethod:
(NSArray *) - sortedArrayDescendingWithMethod:
(NSArray *) - sortedArrayWithMethod:
(NSArray *) - sortedArrayAscending
(NSArray *) - sortedArrayDescending
(NSArray *) - sortedArray

Creating and Initializing Array

(NSArray *) + arrayWithContentsOfSerializedFile:
(NSArray *) + arrayWithDataDictionary:
(NSArray *) + arrayWithDataDictionaryFromFile:
(NSArray *) + arrayWithCoder:
(NSArray *) + arrayWithStream:
(NSArray *) + arrayWithFileStream:
(NSArray *) + arraySortedAscendingWithArray:usingMethod:
(NSArray *) + arraySortedDescendingWithArray:usingMethod:
(NSArray *) + arraySortedWithArray:usingMethod:
(NSArray *) + arraySortedAscendingWithArray:
(NSArray *) + arraySortedDescendingWithArray:
(NSArray *) + arraySortedWithArray:
(id) - initWithContentsOfSerializedFile:
(id) - initWithDataDictionary:
(id) - initWithDataDictionaryFromFile:
(id) - initWithStream:
(id) - initWithFileStream:
(id) - initSortedAscendingWithArray:usingMethod:
(id) - initSortedDescendingWithArray:usingMethod:
(id) - initSortedWithArray:usingMethod:
(id) - initSortedAscendingWithArray:
(id) - initSortedDescendingWithArray:
(id) - initSortedWithArray:

Detailed Description

Additional functionality for class NSArray.

Category SCNSArray extends functionality of standard class NSArray.
This category was introduced in version 1.1.3.

Category declares the following properties:


Member Function Documentation

- (void) appendToFileStream: (NSString *)  path

Appends the array to the new or existing stream file with the specified path.

Parameters:
path- stream file path
Exceptions:
SCStreamException- stream operation error detected
+ (NSArray *) arraySortedAscendingWithArray: (NSArray *)  array

Returns the array created by using the ascending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arraySortedAscendingWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Returns the array created by using the ascending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arraySortedDescendingWithArray: (NSArray *)  array

Returns the array created by using the descending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arraySortedDescendingWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Returns the array created by using the descending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arraySortedWithArray: (NSArray *)  array

Returns the array created by using the ascending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arraySortedWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Returns the array created by using the ascending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A created array
Exceptions:
SCStreamException- array error detected
+ (NSArray *) arrayWithCoder: (NSCoder *)  coder

Returns the array created by using the specified coder.

Parameters:
coder- source coder
Returns:
A created array
+ (NSArray *) arrayWithContentsOfSerializedFile: (NSString *)  path

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

Parameters:
path- source serialized file path
Returns:
A created array
+ (NSArray *) arrayWithDataDictionary: (NSDictionary *)  dictionary

Returns the array created by using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A created array
+ (NSArray *) arrayWithDataDictionaryFromFile: (NSString *)  path

Returns the array created by using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A created array
+ (NSArray *) arrayWithFileStream: (NSString *)  path

Returns the array created from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A created array
Exceptions:
SCStreamException- stream operation error detected
+ (NSArray *) arrayWithStream: (SCStream *)  stream

Returns the array created from the specified stream.

Parameters:
stream- stream for reading class instance
Returns:
A created array
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (NSString *) className

Returns the receiver's array class name.

Returns:
Class name
- (SCComparisonResult) compareWithObject: (id<SCCollectionProtocol>)  object

Returns the result of comparison receiver's array with the specified array.

Parameters:
object- second array for comparison
Returns:
Result of comparison:
  • SCComparisonEqual - arrays are equal
  • SCComparisonLess - the receiver's array is less than second array
  • SCComparisonGreater - the receiver's array is greater than second array
  • SCComparisonNotAllowed - instances cannot be compared
Exceptions:
SCCollectionException- incompatible second array detected
- (id< SCCollectionProtocol >) copyObject

Returns the copy of the array.

Returns:
Copy of the receiver's array
- (NSDictionary *) dataDictionary

Returns the dictionary with the array data.

Returns:
Dictionary with the array data
- (id) initSortedAscendingWithArray: (NSArray *)  array

Initializes the array using the ascending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initSortedAscendingWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Initializes the array using the ascending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initSortedDescendingWithArray: (NSArray *)  array

Initializes the array using the descending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initSortedDescendingWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Initializes the array using the descending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initSortedWithArray: (NSArray *)  array

Initializes the array using the ascending sorted objects from the specified existing array.

Parameters:
array- source array
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initSortedWithArray: (NSArray *)  array
usingMethod: (id<SCSortingProtocol>)  method 

Initializes the array using the ascending sorted objects from the specified existing array and with using the specified sorting algorithm.

Parameters:
array- source array
method- sorting algorithm
Returns:
A newly initialized array
Exceptions:
SCStreamException- array error detected
- (id) initWithContentsOfSerializedFile: (NSString *)  path

Initializes the array using the contens of serialized file with the specified path.

Parameters:
path- source serialized file path
Returns:
A newly initialized array
- (id) initWithDataDictionary: (NSDictionary *)  dictionary

Initializes the array using the specified dictionary.

Parameters:
dictionary- source dictionary
Returns:
A newly initialized array
- (id) initWithDataDictionaryFromFile: (NSString *)  path

Initializes the array using the dictionary from the specified file.

Parameters:
path- source dictionary file path
Returns:
A newly initialized array
- (id) initWithFileStream: (NSString *)  path

Initializes array from the stream file with the specified path.

Parameters:
path- stream file path
Returns:
A newly initialized array
Exceptions:
SCStreamException- stream operation error detected
- (id) initWithStream: (SCStream *)  stream

Initializes the array from the specified stream.

Parameters:
stream- stream for reading class instance
Returns:
A newly initialized array
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected
- (BOOL) isArray

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

Returns:
YES if the receiving instance is an array of any type, otherwise NO
- (BOOL) isCollection

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

Returns:
YES if the receiving instance is a collection of any type, otherwise NO
- (BOOL) isDictionary

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

Returns:
YES if the receiving instance is a dictionary of any type, otherwise NO
- (BOOL) isFoundationArray

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

Returns:
YES if the receiving instance is a foundation array of any type, otherwise NO
- (BOOL) isFoundationCollection

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

Returns:
YES if the receiving instance is a foundation collection of any type, otherwise NO
- (BOOL) isFoundationDictionary

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

Returns:
YES if the receiving instance is a foundation dictionary of any type, otherwise NO
- (BOOL) isFoundationOrderedSet

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

Returns:
YES if the receiving instance is a foundation ordered set of any type, otherwise NO
- (BOOL) isFoundationSet

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

Returns:
YES if the receiving instance is a foundation set of any type, otherwise NO
- (BOOL) isLibraryArray

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

Returns:
YES if the receiving instance is a library array of any type, otherwise NO
- (BOOL) isLibraryCollection

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

Returns:
YES if the receiving instance is a library collection of any type, otherwise NO
- (BOOL) isLibraryDictionary

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

Returns:
YES if the receiving instance is a library dictionary, otherwise NO
- (BOOL) isLibraryOrderedSet

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

Returns:
YES if the receiving instance is a library ordered set, otherwise NO
- (BOOL) isLibrarySet

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

Returns:
YES if the receiving instance is a library set, otherwise NO
- (BOOL) isList

Returns a boolean value that indicates whether a receiving instance is a list.

Returns:
YES if the receiving instance is a list of any type, otherwise NO
- (BOOL) isOrderedSet

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

Returns:
YES if the receiving instance is an ordered set of any type, otherwise NO
- (BOOL) isQueue

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

Returns:
YES if the receiving instance is a queue, otherwise NO
- (BOOL) isSet

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

Returns:
YES if the receiving instance is a set of any type, otherwise NO
- (BOOL) isSortable

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

Returns:
YES if the receiving instance is a sortable collection of any type, otherwise NO
- (BOOL) isStack

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

Returns:
YES if the receiving instance is a stack, otherwise NO
- (NSArray *) sortedArray

Returns an array with ascending sorted objects from receiving array.

Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (NSArray *) sortedArrayAscending

Returns an array with ascending sorted objects from receiving array.

Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (NSArray *) sortedArrayAscendingWithMethod: (id<SCSortingProtocol>)  method

Returns an array with ascending sorted objects from receiving array using the specified sorting algorithm.

Parameters:
method- sorting algorithm
Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (NSArray *) sortedArrayDescending

Returns an array with descending sorted objects from receiving array.

Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (NSArray *) sortedArrayDescendingWithMethod: (id<SCSortingProtocol>)  method

Returns an array with descending sorted objects from receiving array using the specified sorting algorithm.

Parameters:
method- sorting algorithm
Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (NSArray *) sortedArrayWithMethod: (id<SCSortingProtocol>)  method

Returns an array with ascending sorted objects from receiving array using the specified sorting algorithm.

Parameters:
method- sorting algorithm
Returns:
Array with sorted objects
Exceptions:
SCCollectionException- array error detected
- (BOOL) writeContentsToSerializedFile: (NSString *)  path

Writes array encoded data into the serialized file with the specified path.

Parameters:
path- path at which to write the file
Returns:
YES if operation is successfully, otherwise NO
- (void) writeToDataDictionary: (NSMutableDictionary *)  dictionary

Writes the array data into the specified dictionary.

Parameters:
dictionary- destination dictionary
- (void) writeToDataDictionaryFile: (NSString *)  path

Atomically writes the array data into the dictionary file with the specified path.

Parameters:
path- path at which to write the file
- (void) writeToDataDictionaryFile: (NSString *)  path
atomically: (BOOL)  atomically 

Writes the array data into the dictionary file with the specified path.

Parameters:
path- path at which to write the file
atomically- YES for writing data to an auxiliary file, and then the auxiliary file is renamed to path, NO for writing data directly to path
- (void) writeToFileStream: (NSString *)  path

Saves the array instance to the created stream file with the specified path.

Parameters:
path- stream file path
Exceptions:
SCStreamException- stream operation error detected
- (void) writeToStream: (SCStream *)  stream

Saves the array to the specified stream.

Parameters:
stream- stream for writing array
Exceptions:
SCStreamException- stream operation error detected
SCSystemException- system error detected

The documentation for this category was generated from the following files:
 All Classes Files Functions Typedefs Enumerations Enumerator Defines