ObjFW
Public Member Functions | Static Public Member Functions | Protected Attributes
OFDictionary Class Reference

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

#include <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: (OFDictionary *dict)
id initWithObject:forKey: (id obj,[forKey] id< OFCopying > key)
id initWithObjects:forKeys: (OFArray *objs,[forKeys] OFArray *keys)
id initWithKeysAndObjects: (id< OFCopying > first,[,]...)
id initWithKey:argList: (id< OFCopying > first,[argList] va_list args)
id objectForKey: (id key)
OFEnumeratorkeyEnumerator ()
void enumerateKeysAndObjectsUsingBlock: (of_dictionary_enumeration_block_t block)
OFDictionarymappedDictionaryUsingBlock: (of_dictionary_map_block_t block)
OFDictionaryfilteredDictionaryUsingBlock: (of_dictionary_filter_block_t block)

Static Public Member Functions

id dictionary ()
id dictionaryWithDictionary: (OFDictionary *dict)
id dictionaryWithObject:forKey: (id obj,[forKey] id< OFCopying > key)
id dictionaryWithObjects:forKeys: (OFArray *objs,[forKeys] OFArray *keys)
id dictionaryWithKeysAndObjects: (id< OFCopying > key,[,]...)

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 OFDictionary::dictionary ( ) [static, virtual]

Creates a new OFDictionary.

Returns:
A new autoreleased OFDictionary
id OFDictionary::dictionaryWithDictionary: ( OFDictionary dict) [static, virtual]

Creates a new OFDictionary with the specified dictionary.

Parameters:
dictAn OFDictionary
Returns:
A new autoreleased OFDictionary
id OFDictionary::dictionaryWithKeysAndObjects: ( id <OFCopying key,
[,]   ... 
) [static, virtual]

Creates a new OFDictionary with the specified keys objects.

Parameters:
keyThe first key
Returns:
A new autoreleased OFDictionary
id OFDictionary::dictionaryWithObject:forKey: ( id  obj,
[forKey] id <OFCopying key 
) [static, virtual]

Creates a new OFDictionary with the specified key and object.

Parameters:
keyThe key
objThe object
Returns:
A new autoreleased OFDictionary
id OFDictionary::dictionaryWithObjects:forKeys: ( OFArray objs,
[forKeys] OFArray keys 
) [static, virtual]

Creates a new OFDictionary with the specified keys and objects.

Parameters:
keysAn array of keys
objsAn array of objects
Returns:
A new autoreleased OFDictionary
void OFDictionary::enumerateKeysAndObjectsUsingBlock: ( of_dictionary_enumeration_block_t  block) [virtual]

Executes a block for each key / object pair.

Parameters:
blockThe block to execute for each key / object pair.
OFDictionary * OFDictionary::filteredDictionaryUsingBlock: ( of_dictionary_filter_block_t  block) [virtual]

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

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

Initializes an already allocated OFDictionary.

Returns:
An initialized OFDictionary

Reimplemented from OFObject.

id OFDictionary::initWithDictionary: ( OFDictionary dict) [virtual]

Initializes an already allocated OFDictionary with the specified OFDictionary.

Parameters:
dictAn OFDictionary
Returns:
An initialized OFDictionary
id OFDictionary::initWithKey:argList: ( id <OFCopying first,
[argList] va_list  args 
) [virtual]

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

Parameters:
firstThe first key
argsA va_list of the other arguments
Returns:
A new initialized OFDictionary
id OFDictionary::initWithKeysAndObjects: ( id <OFCopying first,
[,]   ... 
) [virtual]

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

Parameters:
firstThe first key
Returns:
A new initialized OFDictionary
id OFDictionary::initWithObject:forKey: ( id  obj,
[forKey] id <OFCopying key 
) [virtual]

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

Parameters:
keyThe key
objThe object
Returns:
A new initialized OFDictionary
id OFDictionary::initWithObjects:forKeys: ( OFArray objs,
[forKeys] OFArray keys 
) [virtual]

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

Parameters:
keysAn array of keys
objsAn array of objects
Returns:
A new initialized OFDictionary
OFEnumerator * OFDictionary::keyEnumerator ( ) [virtual]
Returns:
An OFEnumerator to enumerate through the dictionary's keys
OFDictionary * OFDictionary::mappedDictionaryUsingBlock: ( of_dictionary_map_block_t  block) [virtual]

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

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

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:
keyThe 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