IDictionary (interface)

Usage

Linkage:

-lopenxds_adt

To use the interface:

#include <openxds.adt/IDictionary.h>

using namespace openxds::adt;

Method Summary

ReturnsMethod-nameParametersThrows
IEntry(E)* insert const char* key E* element
IEntry(E)* insertRef const char* key E& element
E* remove IEntry(E)* e
IEntry(E)* find const char* key NoSuchElementException*
IEntry(E)* startsWith const char* key NoSuchElementException*
IEIterator(E)* findAll const char* key
IEIterator(E)* entries
IIterator(E)* values
bool isEmpty
long size

Methods


insert

IEntry<E>* insert( const char* key, E* element );

Parameters

key, to associate the value with in the dictonary.

element, to be stored in the dictionary.

Returns

A new entry that corresponds to the underlying position in the dictionary.


insert

IEntry<E>* insertRef( const char* key, E& element );

Parameters

key, to associate the value with in the dictonary.

element, reference to be stored in the dictionary.

Returns

A new entry that corresponds to the underlying position in the dictionary.


insertRef

IEntry<E>* insertRef( const char* key, E& element );

Parameters

key, to associate the value with in the dictonary.

element, reference to be stored in the dictionary.

Returns

A new entry that corresponds to the underlying position in the dictionary.


remove

E* remove( IEntry<E>* e );

Parameters

e, the entry to be removed from the dictionary.

Returns

The element that was stored in the entry.


find

IEntry<E>* find( const char* key ) throw (NoSuchElementException*);

Parameters

key, that identifies one or more entries in the dictionary.

Returns

A new entry instance that corresponds to the first entry in the dictionary that is identifeid by key.

Throws

NoSuchElementException if no entry in the dictionary is identified by key.


startsWith

IEntry<E>* startsWith( const char* key ) throw (NoSuchElementException*);

Parameters

key, that identifies one or more entries in the dictionary.

Returns

A new entry instance that corresponds to the first entry in the dictionary who key starts with key.

Throws

NoSuchElementException if no entry's key starts with key.


findAll

IEIterator<E>* findAll( const char* key );

Parameters

key, that identifies one or more entries in the dictionary.

Returns

A new entry iterator that iterates over all entries that are identified by key.


entries

IEIterator<E>* entries();

Returns

A new entry iterator that iterates over all entries in the dictionary.


values

IIterator<E>* values();

Returns

A new iterator that iterates over all values in the dictionary.


isEmpty

bool isEmpty();

Returns

TRUE, if the tree is empty; otherwise FALSE.


size

long size();

Returns

The number of nodes in the tree.