Public Member Functions | |
(id) | - initWithDictionary: [implementation] |
(id) | - initWithObjects:forKeys: [implementation] |
(CPDictionary) | - copy [implementation] |
(int) | - count [implementation] |
(CPArray) | - allKeys [implementation] |
(CPArray) | - allValues [implementation] |
(CPEnumerator) | - keyEnumerator [implementation] |
(CPEnumerator) | - objectEnumerator [implementation] |
(BOOL) | - isEqualToDictionary: [implementation] |
(id) | - objectForKey: [implementation] |
(void) | - removeAllObjects [implementation] |
(void) | - removeObjectForKey: [implementation] |
(void) | - setObject:forKey: [implementation] |
(CPString) | - description [implementation] |
(id) | - initWithCoder: [implementation] |
(void) | - encodeWithCoder: [implementation] |
(id) | - valueForKey: [implementation] |
(void) | - setValue:forKey: [implementation] |
Static Public Member Functions | |
(id) | + dictionary [implementation] |
(id) | + dictionaryWithDictionary: [implementation] |
(id) | + dictionaryWithObject:forKey: [implementation] |
(id) | + dictionaryWithObjects:forKeys: [implementation] |
If you are familiar with dictionaries in Cocoa, you'll notice that there is no CPMutableDictionary class. The regular CPDictionary has setObject:
and removeObjectForKey:
methods. In Cappuccino there is no distinction between immutable and mutable classes. They are all mutable.
Definition at line 73 of file CPDictionary.j.
- (CPArray) allKeys | [implementation] |
Returns an array of keys for all the entries in the dictionary.
Definition at line 186 of file CPDictionary.j.
- (CPArray) allValues | [implementation] |
Returns an array of values for all the entries in the dictionary.
Definition at line 194 of file CPDictionary.j.
- (CPDictionary) copy | [implementation] |
return a copy of the receiver (does not deep copy the objects contained in the dictionary).
Definition at line 170 of file CPDictionary.j.
- (int) count | [implementation] |
Returns the number of entries in the dictionary
Definition at line 178 of file CPDictionary.j.
- (CPString) description | [implementation] |
Returns a human readable description of the dictionary.
Definition at line 414 of file CPDictionary.j.
+ (id) dictionary | [implementation] |
Returns a new empty CPDictionary.
Definition at line 88 of file CPDictionary.j.
+ (id) dictionaryWithDictionary: | (CPDictionary) | aDictionary | [implementation] |
Returns a new dictionary, initialized with the contents of aDictionary
.
aDictionary | the dictionary to copy key-value pairs from |
Definition at line 98 of file CPDictionary.j.
+ (id) dictionaryWithObject: | (id) | anObject | ||
forKey: | (id) | aKey | ||
[implementation] |
Creates a new dictionary with single key-value pair.
anObject | the object for the paring | |
aKey | the key for the pairing |
Definition at line 109 of file CPDictionary.j.
Creates a dictionary with multiple key-value pairs.
objects | the objects to place in the dictionary | |
keys | the keys for each of the objects |
CPInvalidArgumentException | if the number of objects and keys is different |
Definition at line 121 of file CPDictionary.j.
- (void) encodeWithCoder: | (CPCoder) | aCoder | [implementation] |
Archives the dictionary to a provided coder.
aCoder | the coder to which the dictionary data will be archived. |
Definition at line 446 of file CPDictionary.j.
- (id) initWithCoder: | (CPCoder) | aCoder | [implementation] |
Definition at line 437 of file CPDictionary.j.
- (id) initWithDictionary: | (CPDictionary) | aDictionary | [implementation] |
Initializes the dictionary with the contents of another dictionary.
aDictionary | the dictionary to copy key-value pairs from |
Definition at line 131 of file CPDictionary.j.
Initializes the dictionary from the arrays of keys and objects.
objects | the objects to put in the dictionary | |
keyArray | the keys for the objects to put in the dictionary |
CPInvalidArgumentException | if the number of objects and keys is different |
Definition at line 149 of file CPDictionary.j.
- (BOOL) isEqualToDictionary: | (CPDictionary) | aDictionary | [implementation] |
Compare the receiver to this dictionary, and return whether or not they are equal.
Definition at line 224 of file CPDictionary.j.
- (CPEnumerator) keyEnumerator | [implementation] |
Returns an enumerator that enumerates over all the dictionary's keys.
Definition at line 208 of file CPDictionary.j.
- (CPEnumerator) objectEnumerator | [implementation] |
Returns an enumerator that enumerates over all the dictionary's values.
Definition at line 216 of file CPDictionary.j.
- (id) objectForKey: | (CPString) | aKey | [implementation] |
Returns the object for the entry with key aKey
.
aKey | the key for the object's entry |
Definition at line 306 of file CPDictionary.j.
- (void) removeAllObjects | [implementation] |
Removes all the entries from the dictionary.
Definition at line 347 of file CPDictionary.j.
- (void) removeObjectForKey: | (id) | aKey | [implementation] |
Removes the entry for the specified key.
aKey | the key of the entry to be removed |
Definition at line 358 of file CPDictionary.j.
- (void) setObject: | (id) | anObject | ||
forKey: | (id) | aKey | ||
[implementation] |
Adds an entry into the dictionary.
anObject | the object for the entry | |
aKey | the entry's key |
Definition at line 394 of file CPDictionary.j.
- (void) setValue: | (id) | aValue | ||
forKey: | (CPString) | aKey | ||
[implementation] |
Definition at line 274 of file CPKeyValueCoding.j.
- (id) valueForKey: | (CPString) | aKey | [implementation] |
Definition at line 269 of file CPKeyValueCoding.j.