Rudiments
Public Member Functions
linkedlistnode< datatype > Class Template Reference

Inherited by dictionarylistnode< char *, datatype >, dictionarylistnode< const char *, datatype >, and dictionarylistnode< int32_t, datatype >.

List of all members.

Public Member Functions

 linkedlistnode ()
virtual ~linkedlistnode ()
void setData (datatype data)
datatype getData () const
int32_t compare (datatype data) const
void setPrevious (linkedlistnode< datatype > *previous)
void setNext (linkedlistnode< datatype > *next)
linkedlistnode< datatype > * getPrevious ()
linkedlistnode< datatype > * getNext ()
void print () const

Detailed Description

template<class datatype>
class linkedlistnode< datatype >

The linkedlistnode class stores the values that compose a linkedlist.


Constructor & Destructor Documentation

template<class datatype>
linkedlistnode< datatype >::linkedlistnode ( )

Creates an empty instance of the linkedlistnode class.

template<class datatype>
virtual linkedlistnode< datatype >::~linkedlistnode ( ) [virtual]

Deletes this instance of the linkedlistnode class. Note however, that the data stored in the linkedlistnode is not deleted by this call.


Member Function Documentation

template<class datatype>
int32_t linkedlistnode< datatype >::compare ( datatype  data) 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 datatype>
datatype linkedlistnode< datatype >::getData ( ) const

Return the data stored in the node.

template<class datatype>
linkedlistnode<datatype>* linkedlistnode< datatype >::getNext ( )

Returns the next node in the linkedlist.

template<class datatype>
linkedlistnode<datatype>* linkedlistnode< datatype >::getPrevious ( )

Returns the previous node in the linkedlist.

template<class datatype>
void linkedlistnode< datatype >::print ( ) const

Prints the data stored in the node.

template<class datatype>
void linkedlistnode< datatype >::setData ( datatype  data)

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

template<class datatype>
void linkedlistnode< datatype >::setNext ( linkedlistnode< datatype > *  next)

Sets the pointer to the next node to "next".

template<class datatype>
void linkedlistnode< datatype >::setPrevious ( linkedlistnode< datatype > *  previous)

Sets the pointer to the previous node to "previous".