nsIDictionary

IID:1dd0cb45-aea3-4a52-8b29-01429a542863
Inherits From:nsISupports

A simple mutable table of objects, accessed by key.

This interface is implemented by the following components:


Methods

void clear ( ) nsISupports deleteValue ( char* key ) void getKeys ( out PRUint32 count , out arrayof char* keys ) nsISupports getValue ( char* key ) PRBool hasKey ( char* key ) void setValue ( char* key , nsISupports value )

void clear ( )

Delete all key-value pairs from the dictionary.


nsISupports deleteValue ( char* key )

Delete the indicated key-value pair.

Arguments:
key: The key indicating the pair to be removed.
Returns:
The removed value. If the key doesn't exist, NS_ERROR_FAILURE will be returned.

void getKeys ( out PRUint32 count , out arrayof char* keys )

Retrieve all keys in the dictionary.

Arguments:
count
keys
Returns:
array of all keys, unsorted.

nsISupports getValue ( char* key )

Find the value indicated by the key.

Arguments:
key: The lookup key indicating the value.
Returns:
Value indicated by key. If the key doesn't exist, NS_ERROR_FAILURE will be returned.

PRBool hasKey ( char* key )

Check if a given key is present in the dictionary.

Arguments:
key: Key to check for
Returns:
true if present, false if absent.

void setValue ( char* key , nsISupports value )

Add the key-value pair to the dictionary. If the key is already present, replace the old value with the new.

Arguments:
key: The key by which the value can be accessed
value: The value to be stored.

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com