Dictionary class.
More...
#import <SCDictionary.h>
Dictionary class.
- SDK
- macOS 10.6+, iOS 7.0+, GNUstep
- Since
- version 1.1.3
Implements the collection which uses the keys for access to the objects. Class also supports the data trees.
Class instances can thrown the following exceptions:
- (void) addArray: |
|
(SCArray *) |
array |
|
Adds into the receiving dictionary objects from a given array.
- Parameters
-
array | - the array with objects to add into the dictionary |
- Exceptions
-
- Since
- version 1.2.3
- See also
- - addObjectsFromArray:
Adds to the receiving dictionary the entries from a given another dictionary.
- Parameters
-
dictionary | - the dictionary from which to add entries |
- Exceptions
-
- Since
- version 1.2.3
- See also
- - addEntriesFromDictionary:
- (void) addEntriesFromDictionary: |
|
(SCDictionary *) |
dictionary |
|
Adds to the receiving dictionary the entries from a given another dictionary.
- Parameters
-
dictionary | - the dictionary from which to add entries |
- Exceptions
-
- Since
- version 1.2.3
- See also
- - addDictionary:
Adds to the receiving dictionary the entries constructed from the contents of a given collection of keys and the specified collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new entries |
keys | - a collection containing the keys for the new entries |
- Since
- version 1.2.3
- (void) addObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Adds to the receiving dictionary the entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Since
- version 1.2.3
- (void) addObjectsFromArray: |
|
(SCArray *) |
array |
|
Adds into the receiving dictionary objects from a given array.
- Parameters
-
array | - the array with objects to add into the dictionary |
- Exceptions
-
- Since
- version 1.2.3
- See also
- - addArray:
Returns a new array containing the keys corresponding to all occurrences of a given object in the dictionary.
- Parameters
-
object | - the object to look for in the dictionary |
- Returns
- A new array containing the keys corresponding to all occurrences of the specified object in the dictionary
Returns a boolean value that indicates whether an objects for all keys from the specified collection of any supported type are present in the receiving dictionary.
- Parameters
-
keys | - the collection with keys |
- Returns
- YES if all objects are present in the dictionary, otherwise NO
- (BOOL) containsAnyKey: |
|
(NSString *) |
key |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Returns a boolean value that indicates whether the receiving dictionary contains objects for at least one key from the specified list.
- Parameters
-
key | - the first key to find within the receiving dictionary |
... | - a comma-separated list of additional keys, ending with nil pointer |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- YES if the receiving dictionary contains objects for at least one key from the list, otherwise NO
- (BOOL) containsAnyKeyFromCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a boolean value that indicates whether the receiving dictionary contains objects for at least one key from the specified collection of any supported type.
- Parameters
-
collection | - the collection with the required keys |
- Returns
- YES if the receiving dictionary contains obejcts for at least one key from the specified collection, otherwise NO
Returns a boolean value that indicates whether an object for at least one key from the specified collection of any supported type is present in the receiving dictionary.
- Parameters
-
keys | - the collection with keys |
- Returns
- YES if at least one object is present in the dictionary, otherwise NO
- (BOOL) containsKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether the receiving dictionary contains an object for a specified key.
- Parameters
-
- Returns
- YES if a dictionary contains an object for a given key, otherwise NO
- (BOOL) containsKeys: |
|
(NSString *) |
key |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Returns a boolean value that indicates whether the receiving dictionary contains objects for all keys from the specified list.
- Parameters
-
key | - the first key to find within the receiving dictionary |
... | - a comma-separated list of additional keys, ending with nil pointer |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- YES if objects for all keys are present in the receiving dictiomary, otherwise NO
- (BOOL) containsKeysFromCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a boolean value that indicates whether the receiving dictionary contains objects for all keys from the specified collection of any supported type.
- Parameters
-
collection | - the collection with the required keys |
- Returns
- YES if the objects for all required keys are present in the receiving dictionary, otherwise NO
- (BOOL) containsNumberForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether a number for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired number |
- Returns
- YES if a number for the given key is present in the dictionary, otherwise NO
- (BOOL) containsObjectForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether an object for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired object |
- Returns
- YES if an object for the given key is present in the dictionary, otherwise NO
- (BOOL) containsStringForKey: |
|
(NSString *) |
key |
|
Returns a boolean value that indicates whether a string for the given key is present in the receiving dictionary.
- Parameters
-
key | - the key for the desired string |
- Returns
- YES if a string for the given key is present in the dictionary, otherwise NO
+ (instancetype) dictionary |
|
|
|
Creates and returns an unnamed empty dictionary.
- Returns
- A created dictionary
Returns the new dictionary that contains entries from the receiving dictionary and entries constructed by using objects from a given array.
- Parameters
-
array | - an array of objects to add to the new dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and objects from a given array
- Exceptions
-
- Since
- version 1.2.3
- See also
- - dictionaryByAddingObjectsFromArray:
Returns the new dictionary that contains entries from the receiving dictionary and objects from a given collection.
- Parameters
-
collection | - the collection of objects to add to the new dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and objects from the specified collection
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and entries from a given another dictionary.
- Parameters
-
dictionary | - the dictionary with entries to add to the new dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and entries from the specified dictionary
- Exceptions
-
- Since
- version 1.2.3
- See also
- - dictionaryByAddingEntriesFromDictionary:
Returns the new dictionary that contains entries from the receiving dictionary and entries from a given another dictionary.
- Parameters
-
dictionary | - the dictionary with entries to add to the new dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and entries from the specified dictionary
- Exceptions
-
- Since
- version 1.2.3
- See also
- - dictionaryByAddingDictionary:
Returns the new dictionary that contains entries from the receiving dictionary and a new entry with a given object and automatic generated key.
- Parameters
-
object | - the object to add to the dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and a new entry with a given object
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and a new entry with the specified object and key.
- Parameters
-
object | - the object to add to the new dictionary |
key | - the key associated with the specified object |
- Returns
- A dictionary with entries from the receiving dictionary and a new entry with the specified object and key
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and a new entries constructed by using objects from a given list with automatic generated keys.
- Parameters
-
object | - the first object to add into the dictionary |
... | - a comma-separated list of additional objects, ending with nil pointer |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A dictionary with entries from the receiving dictionary and entries constructed by using objects from the specified list and automatic generated keys
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and a new entries constructed from the contents of a given collection of keys and the specified collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new entries |
keys | - a collection containing the keys for the new entries |
- Returns
- A dictionary with entries from the receiving dictionary and entries constructed by using objects and keys from the specified collections
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and a new entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A dictionary with entreis from the receiving dictionary and entries from the specified set of objects and keys
- Exceptions
-
- Since
- version 1.2.3
Returns the new dictionary that contains entries from the receiving dictionary and entries constructed by using objects from a given array.
- Parameters
-
array | - an array of objects to add to the new dictionary |
- Returns
- A dictionary with entries from the receiving dictionary and objects from a given array
- Exceptions
-
- Since
- version 1.2.3
- See also
- - dictionaryByAddingArray:
+ (instancetype) dictionaryWithCoder: |
|
(NSCoder *) |
coder |
|
Returns a dictionary created by using the specified coder.
- Parameters
-
- Returns
- A created dictionary
+ (instancetype) dictionaryWithCollection: |
|
(id<SCCollection>) |
collection |
|
Returns a dictionary created by using the objects from the specified collection of any supported type.
- Parameters
-
collection | - the existing source collection |
- Returns
- A created dictionary
- Exceptions
-
+ (instancetype) dictionaryWithContentsOfFile: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the file with the specified path.
- Parameters
-
path | - the path to the source file |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithContentsOfSerializedFile: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the content of the serialized file with the specified path.
- Parameters
-
path | - the path to the source serialized file |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithContentsOfURL: |
|
(NSURL *) |
url |
|
Returns a dictionary created by using the specified URL.
- Parameters
-
- Returns
- A created dictionary
+ (instancetype) dictionaryWithContentsOfURLString: |
|
(NSString *) |
urlString |
|
Returns a dictionary created by using the data from the URL with the specified string.
- Parameters
-
urlString | - the string of the source URL |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithData: |
|
(NSData *) |
data |
|
Returns a dictionary created by using the specified data object.
- Parameters
-
data | - the source data object |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDataDictionary: |
|
(NSDictionary *) |
dictionary |
|
Returns a dictionary created by using the specified data dictionary.
- Parameters
-
dictionary | - the source data dictionary |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDataDictionaryFromFile: |
|
(NSString *) |
path |
|
Returns a dictionary created by using the data dictionary from the specified file.
- Parameters
-
path | - the path to the source data dictionary file |
- Returns
- A created dictionary
+ (instancetype) dictionaryWithDictionary: |
|
(SCDictionary *) |
dictionary |
|
Creates and returns a dictionary containing keys and objects from another given dictionary.
- Parameters
-
dictionary | - a dictionary containing the keys and values with which to initialize the new dictionary |
- Returns
- A new dictionary containing the keys and values found in the specified dictionary
- Exceptions
-
+ (instancetype) dictionaryWithFileStream: |
|
(NSString *) |
path |
|
Returns a dictionary 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 dictionary
- Exceptions
-
+ (instancetype) dictionaryWithName: |
|
(NSString *) |
name |
|
Returns an empty dictionary created by using the specified dictionary name.
- Parameters
-
name | - the dictionary name |
- Returns
- A created dictionary
Creates and returns a dictionary containing a given object with the automatic generated key.
- Parameters
-
object | - the object to adding into the dictionary |
- Returns
- A new dictionary containing a single object
Creates and returns a dictionary containing a given key and object.
- Parameters
-
object | - the object corresponding to the specified key |
key | - the key for the specified object |
- Returns
- A new dictionary containing a single object for a single key
Creates and returns a dictionary containing objects from the specified nil terminated list and automatic generated keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - other objects to add to the new dictionary |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A new dictionary containing the specified objects
Creates and returns a dictionary containing entries constructed from the contents of a collection of keys and a collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new dictionary |
keys | - a collection containing the keys for the new dictionary |
- Returns
- A new dictionary containing entries constructed from the contents of the specified collections
+ (instancetype) dictionaryWithObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Creates and returns a dictionary containing entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- A new dictionary
+ (instancetype) dictionaryWithStream: |
|
(SCStream *) |
stream |
|
Returns a dictionary created by using the data from the specified stream.
- Parameters
-
stream | - the source stream |
- Returns
- A created dictionary
- Exceptions
-
Initializes an empty unnamed dictionary.
- Returns
- A newly initialized dictionary
Reimplemented from SCCollection.
- (instancetype) initWithCollection: |
|
(id<SCCollection>) |
collection |
|
Initializes a newly allocated dictionary with objects from the specified collection with automatic generated keys.
- Parameters
-
collection | - a collection with objects to add to the new dictionary |
- Returns
- An initialized dictionary with the objects from a given collection
- Exceptions
-
Reimplemented from SCCollection.
- (instancetype) initWithDictionary: |
|
(SCDictionary *) |
dictionary |
|
Initializes a newly allocated dictionary by placing in it the keys and objects contained in another given dictionary.
- Attention
- Designed initializer
- Parameters
-
dictionary | - a dictionary containing the keys and objects with which to initialize the new dictionary |
- Returns
- An initialized dictionary containing the keys and objects found in the specified source dictionary
- Exceptions
-
- (instancetype) initWithName: |
|
(NSString *) |
name |
|
Initializes an empty dictionary using the specified dictionary name.
Designed initializer
- Parameters
-
name | - the dictionary name |
- Returns
- A newly initialized dictionary
Reimplemented from SCCollection.
Initializes a newly allocated dictionary containing a given object with the automatic generated key.
- Parameters
-
object | - the object to adding into the dictionary |
- Returns
- An initialized dictionary containing a single object
Initializes a newly allocated dictionary containing a given key and object.
- Parameters
-
object | - the object corresponding to the specified key |
key | - the key for the specified object |
- Returns
- An initialized dictionary containing a single object for a single key
- (instancetype) initWithObjects: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Initializes a newly allocated dictionary containing objects from the specified nil terminated list and automatic generated keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - other objects to add to the new dictionary |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- An initialized dictionary containing the specified objects
Initializes a newly allocated dictionary containing entries constructed from the contents of a collection of keys and a collection of objects.
- Parameters
-
objects | - a collection containing the objects for the new dictionary |
keys | - a collection containing the keys for the new dictionary |
- Returns
- An initialized dictionary containing entries constructed from the contents of the specified collections
- (instancetype) initWithObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Initializes a newly allocated dictionary with entries constructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the new dictionary |
... | - first key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Returns
- An initialized dictionary
Returns a boolean value that indicates whether the settings and contents of the receiving dictionary are equal to the settings and content of another given dictionary.
- Parameters
-
dictionary | - the dictionary with which to compare the receiving dictionary |
- Returns
- YES if the settings and contents of the specified dictionary are equal to the settings and contents of the receiving dictionary, otherwise NO
- (id) objectForKey: |
|
(NSString *) |
key |
|
Returns the object associated with a given key.
- Parameters
-
key | - the key for which to return the corresponding object |
- Returns
- The object associated with the specified key or nil if no object is associated with the key
- See also
- - valueForKey:
Reimplemented from <SCKeyedCollection>.
- (id) objectForKeyedSubscript: |
|
(NSString *) |
key |
|
Returns the value associated with a given key.
- Parameters
-
key | - the key for which to return the corresponding value |
- Returns
- The value associated with a given key or nil if no value is associated with a key
- Exceptions
-
- Since
- version 1.2.5
Reimplemented from <SCKeyedCollection>.
- (void) removeObjectForKey: |
|
(NSString *) |
key |
|
Removes a given key and its associated object from the receiving dictionary.
- Parameters
-
- Exceptions
-
Reimplemented from <SCMutableKeyedCollection>.
- (void) removeObjectsForKeys: |
|
(SCArray *) |
keys |
|
Removes from the receiving dictionary entries specified specified by elements in a given array.
- Parameters
-
keys | - an array of objects specifying the keys to remove |
- Exceptions
-
Sets the settings and contents of the receiving dictionary to settings and entries in a given dictionary.
- Parameters
-
dictionary | - the source dictionary |
- Exceptions
-
Adds a given key-object pair to the dictionary.
- Parameters
-
object | - the object for the specified key |
key | - the key for the specified object |
- Exceptions
-
- See also
- - setValue:forKey:
Reimplemented from <SCMutableKeyedCollection>.
Adds a given key-value pair to the dictionary.
- Parameters
-
object | - the value for a given key |
key | - the key for a goven value |
- Exceptions
-
- Since
- version 1.2.5
Reimplemented from <SCMutableKeyedCollection>.
Adds a key-object pairs from the specified collection of the objects and a given collection of the keys.
- Parameters
-
objects | - the collection of the objects |
keys | - the collection of the keys |
- Exceptions
-
- (void) setObjectsAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Adds into the receiving dictionary entries cotsructed from the specified set of objects and keys.
- Parameters
-
object | - the first object to add to the dictionary |
... | - first the key for the first object, then a null-terminated list of alternating objects and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
Adds a key-value pairs from the specified collection of the values and a given collection of the keys.
- Parameters
-
values | - the collection of the values |
keys | - the collection of the keys |
- Exceptions
-
- (void) setValuesAndKeys: |
|
(id<SCCollectioning>) |
object |
, |
|
|
NS_REQUIRES_NIL_TERMINATION |
|
|
| |
Adds into the receiving dictionary entries cotsructed from the specified set of values and keys.
- Parameters
-
object | - the first value to add to the dictionary |
... | - first the key for the first value, then a null-terminated list of alternating values and keys |
NS_REQUIRES_NIL_TERMINATION | - the mandatory nil pointer |
- Exceptions
-
- (id) valueForKey: |
|
(NSString *) |
key |
|
Returns the value associated with a given key.
- Parameters
-
key | - the key for which to return the corresponding value |
- Returns
- The value associated with a given key or nil if no value is associated with the key
- See also
- - objectForKey:
Reimplemented from <SCKeyedCollection>.
An array containing the all keys in the dictionary, or an empty array if the dictionary has no entries
An array containing the all values in the dictionary, or an empty array if the dictionary has no entries
- (NSEnumerator *) keyEnumerator |
|
readnonatomicassign |
An enumerator object that lets you access each key in the dictionary
The documentation for this class was generated from the following files: