Rudiments

- Main Page
- Classes

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
dictionarynode< keytype, valuetype > Class Template Reference

## Public Member Functions
| dictionarynode (keytype key, valuetype value)
virtual | ~dictionarynode ()
void | setKey (keytype key)
void | setValue (valuetype value)
keytype | getKey () const
valuetype | getValue () const
int32_t | compare (keytype testkey) const
void | print () const

## Detailed Description

### template<class keytype, class valuetype>
class dictionarynode< keytype, valuetype >

The dictionarynode class stores the key/value pairs that compose a dictionary.

## Constructor & Destructor Documentation

template<class keytype, class valuetype>

dictionarynode< keytype, valuetype >::dictionarynode | ( | keytype | key,
|  | valuetype | value
| ) |  |

Creates an instance of the dictionary node class with key "key" and value "value".

template<class keytype, class valuetype>

virtual dictionarynode< keytype, valuetype >::~dictionarynode | ( |  | ) |
| virtual

Deletes this instance of the dictionarynode class. Note however, that neither the key nor value stored in the dictionarynode are deleted by this call.

## Member Function Documentation

template<class keytype, class valuetype>

int32_t dictionarynode< keytype, valuetype >::compare | ( | keytype | testkey | ) | const

Returns a negative number,0 or a positive number depending on whether the key stored in the node is respectively less than, equal to or greater than "testkey".

template<class keytype, class valuetype>

keytype dictionarynode< keytype, valuetype >::getKey | ( |  | ) | const

Returns the key stored in the node.

template<class keytype, class valuetype>

valuetype dictionarynode< keytype, valuetype >::getValue | ( |  | ) | const

Returns the value stored in the node.

template<class keytype, class valuetype>

void dictionarynode< keytype, valuetype >::print | ( |  | ) | const

Prints a representation of the key and value stored in the node.

template<class keytype, class valuetype>

void dictionarynode< keytype, valuetype >::setKey | ( | keytype | key | ) |

Sets the key stored in the node to "key".

template<class keytype, class valuetype>

void dictionarynode< keytype, valuetype >::setValue | ( | valuetype | value | ) |

Sets the value stored in the node to "value".