Rudiments
Public Member Functions
dictionarynode< keytype, datatype > Class Template Reference

List of all members.

Public Member Functions

 dictionarynode ()
virtual ~dictionarynode ()
void setKey (keytype key)
void setData (datatype data)
keytype getKey () const
datatype getData () const
int32_t compare (keytype testkey) const
void print () const

Detailed Description

template<class keytype, class datatype>
class dictionarynode< keytype, datatype >

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


Constructor & Destructor Documentation

template<class keytype, class datatype>
dictionarynode< keytype, datatype >::dictionarynode ( )

Creates an empty instance of the dictionary node class.

template<class keytype, class datatype>
virtual dictionarynode< keytype, datatype >::~dictionarynode ( ) [virtual]

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


Member Function Documentation

template<class keytype, class datatype>
int32_t dictionarynode< keytype, datatype >::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 datatype>
datatype dictionarynode< keytype, datatype >::getData ( ) const

Returns the data stored in the node.

template<class keytype, class datatype>
keytype dictionarynode< keytype, datatype >::getKey ( ) const

Returns the key stored in the node.

template<class keytype, class datatype>
void dictionarynode< keytype, datatype >::print ( ) const

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

template<class keytype, class datatype>
void dictionarynode< keytype, datatype >::setData ( datatype  data)

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

template<class keytype, class datatype>
void dictionarynode< keytype, datatype >::setKey ( keytype  key)

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