OFDictionary Class Reference

#import <OFDictionary.h>

Inheritance diagram for OFDictionary:
OFObject <OFCopying> <OFMutableCopying> 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:
(size_t) - count
(id) - setObject:forKey:
(id) - removeObjectForKey:
(OFIterator *) - iterator

Static Public Member Functions

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

Protected Attributes

struct of_dictionary_bucketdata
size_t size
size_t count

Detailed Description

The OFDictionary class is a class for using hash tables.


Member Function Documentation

- (size_t) count  
Returns:
The number of objects in the dictionary
+ (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: (OFObject <OFCopying>*)  key
,   ... 

Creates a new OFDictionary with the specified keys objects.

Parameters:
key The first key
Returns:
A new autoreleased OFDictionary
+ (id) dictionaryWithObject: (OFObject*)  obj
forKey: (OFObject <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
- (id) init  

Initializes an already allocated OFDictionary.

Returns:
An initialized OFDictionary

Reimplemented from OFObject.

- (id) initWithDictionary: (OFDictionary*)  dict  

Initializes an already allocated OFDictionary with the specified OFDictionary.

Parameters:
dict An OFDictionary
Returns:
An initialized OFDictionary
- (id) initWithKey: (OFObject <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: (OFObject <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: (OFObject*)  obj
forKey: (OFObject <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
- (OFIterator*) iterator  

Creates an OFIterator for the dictionary.

It will copy the data of the OFDictionary so that OFIterator will always operate on the data that was present when it was created. If you changed the OFDictionary and want to operate on the new data, you need to create a new OFIterator, as using reset will only reset the OFIterator, but won't update the data. It will also retain the data inside the OFDictionary so the OFIterator still works after you released the OFDictionary. Thus, if you want to get rid of the objects in the OFDictionary, you also need to release the OFIterator.

Returns:
An OFIterator for the OFDictionary
- (id) objectForKey: (OFObject <OFCopying>*)  key  
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

Generated on Thu Dec 24 11:10:00 2009 for ObjFW by  doxygen 1.6.1