Class hierarchy Compound list Compound Members

# Dictionary Class Reference

Word Dictionary. More...

List of all members.

## Public Members

- Dictionary ()
    Default Constructor.

- Dictionary (const Dictionary& D)
    Copy Constructor.

- virtual ~Dictionary ()
    Destructor.

- Dictionary& operator= (const Dictionary& D)
    Assignment operator.

- void addWord (const char* word, const int len, const Data Value)
    Add a new word to the dictionary.

- void addWord (const String& word, const Data Value)
    Add a new word to the dictionary.

- int getWord (const char* word, const int len, Data& Value)
    Retrieve an association from the Dictionary.

- int getWord (const String& word, Data& Value)
    Retrieve an association from the Dictionary.

- int isEmpty () const
    Returns non-zero if there are words in the dictionary.

## Detailed Description

Word Dictionary.

An alternative to a Hashtable of subclasses of SimpleString_Containable Provides translation from text word (any string) to a Containable subclass

## Member Function Documentation

### Dictionary::Dictionary()

Default Constructor.

### Dictionary::Dictionary(const Dictionary& D)

Copy Constructor.

### virtual Dictionary::~Dictionary()`[virtual]`

Destructor.

### Dictionary& Dictionary::operator=(const Dictionary& D)

Assignment operator.

### void Dictionary::addWord(const char* word, const int len, const Data Value)

Add a new word to the dictionary.

len indicates the length of the word. Value is the data associated with the word. Method throws WordExists if the word is already in the dictionary.

### void Dictionary::addWord(const String& word, const Data Value)

Add a new word to the dictionary.

Value is the data associated with the word. Method throws WordExists if the word is already in the dictionary.

### int Dictionary::getWord(const char* word, const int len, Data& Value)

Retrieve an association from the Dictionary.

Value will be set if the word is found. Method throws WordNotFound if the word is not in the dictionary.

### int Dictionary::getWord(const String& word, Data& Value)

Retrieve an association from the Dictionary.

Value will be set if the word is found. Method throws WordNotFound if the word is not in the dictionary.

### int Dictionary::isEmpty() const

Returns non-zero if there are words in the dictionary.

The documentation for this class was generated from the following file:

- DS_Container.h