Rudiments
Public Member Functions | List of all members
linkedlistnode< valuetype > Class Template Reference

Public Member Functions

 linkedlistnode (valuetype value)
 
virtual ~linkedlistnode ()
 
void setValue (valuetype value)
 
valuetype getValue () const
 
int32_t compare (valuetype value) const
 
void setPrevious (linkedlistnode< valuetype > *previous)
 
void setNext (linkedlistnode< valuetype > *next)
 
linkedlistnode< valuetype > * getPrevious ()
 
linkedlistnode< valuetype > * getNext ()
 
void print () const
 

Detailed Description

template<class valuetype>
class linkedlistnode< valuetype >

The linkedlistnode class stores the values that compose a linkedlist.

Constructor & Destructor Documentation

template<class valuetype>
linkedlistnode< valuetype >::linkedlistnode ( valuetype  value)

Creates an instance of the linkedlistnode class that stores value "value".

template<class valuetype>
virtual linkedlistnode< valuetype >::~linkedlistnode ( )
virtual

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

Member Function Documentation

template<class valuetype>
int32_t linkedlistnode< valuetype >::compare ( valuetype  value) 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 valuetype>
linkedlistnode<valuetype>* linkedlistnode< valuetype >::getNext ( )

Returns the next node in the linkedlist.

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

Returns the previous node in the linkedlist.

template<class valuetype>
valuetype linkedlistnode< valuetype >::getValue ( ) const

Return the value stored in the node.

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

Prints the value stored in the node.

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

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

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

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

template<class valuetype>
void linkedlistnode< valuetype >::setValue ( valuetype  value)

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