Public Member Functions | Static Public Member Functions | Protected Attributes

OFDictionary Class Reference

A class for storing objects in a hash table. More...

#import <OFDictionary.h>

Inheritance diagram for OFDictionary:
OFObject <OFCopying> <OFMutableCopying> <OFCollection> <OFFastEnumeration> <OFObject> <OFObject> OFMutableDictionary

List of all members.

Public Member Functions

(id) - init
(id) - initWithDictionary:
(id) - initWithObject:forKey:
(id) - initWithObjects:forKeys:
(id) - initWithKeysAndObjects:
(id) - initWithKey:argList:
(id) - objectForKey:
(OFEnumerator *) - keyEnumerator
(void) - enumerateKeysAndObjectsUsingBlock:
(OFDictionary *) - mappedDictionaryUsingBlock:
(OFDictionary *) - filteredDictionaryUsingBlock:

Static Public Member Functions

(id) + dictionary
(id) + dictionaryWithDictionary:
(id) + dictionaryWithObject:forKey:
(id) + dictionaryWithObjects:forKeys:
(id) + dictionaryWithKeysAndObjects:

Protected Attributes

struct of_dictionary_bucket ** data
uint32_t size
size_t count

Detailed Description

A class for storing objects in a hash table.


Member Function Documentation

+ (id) dictionary  

Creates a new OFDictionary.

Returns:
A new autoreleased OFDictionary
+ (id) dictionaryWithDictionary: (OFDictionary*)  dict  

Creates a new OFDictionary with the specified dictionary.

Parameters:
dict An OFDictionary
Returns:
A new autoreleased OFDictionary
+ (id) dictionaryWithKeysAndObjects: (id <OFCopying>)  key
,   ... 

Creates a new OFDictionary with the specified keys objects.

Parameters:
key The first key
Returns:
A new autoreleased OFDictionary
+ (id) dictionaryWithObject: (id)  obj
forKey: (id <OFCopying>)  key 

Creates a new OFDictionary with the specified key and object.

Parameters:
key The key
obj The object
Returns:
A new autoreleased OFDictionary
+ (id) dictionaryWithObjects: (OFArray*)  objs
forKeys: (OFArray*)  keys 

Creates a new OFDictionary with the specified keys and objects.

Parameters:
keys An array of keys
objs An array of objects
Returns:
A new autoreleased OFDictionary
- (void) enumerateKeysAndObjectsUsingBlock: (of_dictionary_enumeration_block_t)  block  

Executes a block for each key / object pair.

Parameters:
block The block to execute for each key / object pair.
- (OFDictionary *) filteredDictionaryUsingBlock: (of_dictionary_filter_block_t)  block  

Returns a new dictionary, only containing the objects for which the block returns YES.

Parameters:
block A block which determines if the object should be in the new dictionary
Returns:
A new, autoreleased OFDictionary
- (id) init  

Initializes an already allocated OFDictionary.

Returns:
An initialized OFDictionary
- (id) initWithDictionary: (OFDictionary*)  dict  

Initializes an already allocated OFDictionary with the specified OFDictionary.

Parameters:
dict An OFDictionary
Returns:
An initialized OFDictionary
- (id) initWithKey: (id <OFCopying>)  first
argList: (va_list)  args 

Initializes an already allocated OFDictionary with the specified key and va_list.

Parameters:
first The first key
args A va_list of the other arguments
Returns:
A new initialized OFDictionary
- (id) initWithKeysAndObjects: (id <OFCopying>)  first
,   ... 

Initializes an already allocated OFDictionary with the specified keys and objects.

Parameters:
first The first key
Returns:
A new initialized OFDictionary
- (id) initWithObject: (id)  obj
forKey: (id <OFCopying>)  key 

Initializes an already allocated OFDictionary with the specified key and object.

Parameters:
key The key
obj The object
Returns:
A new initialized OFDictionary
- (id) initWithObjects: (OFArray*)  objs
forKeys: (OFArray*)  keys 

Initializes an already allocated OFDictionary with the specified keys and objects.

Parameters:
keys An array of keys
objs An array of objects
Returns:
A new initialized OFDictionary
- (OFEnumerator *) keyEnumerator  
Returns:
An OFEnumerator to enumerate through the dictionary's keys
- (OFDictionary *) mappedDictionaryUsingBlock: (of_dictionary_map_block_t)  block  

Returns a new dictionary, mapping each object using the specified block.

Parameters:
block A block which maps an object for each object
Returns:
A new, autorelease OFDictionary
- (id) objectForKey: (id)  key  

Returns the object for the given key or nil if the key was not found.

The returned object is not retained and autoreleased for performance reasons!

Parameters:
key The key whose object should be returned
Returns:
The object for the given key or nil if the key was not found

The documentation for this class was generated from the following files:
 All Classes Functions Variables