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

Public Member Functions

 singlylinkedlistnode (valuetype value)
 
 ~singlylinkedlistnode ()
 
void setValue (valuetype value)
 
valuetype getValue () const
 
int32_t compare (valuetype value) const
 
int32_t compare (singlylinkedlistnode< valuetype > *peer) const
 
singlylinkedlistnode< valuetype > * getNext ()
 
void print () const
 

Detailed Description

template<class valuetype>
class singlylinkedlistnode< valuetype >

The singlylinkedlistnode class stores the values that compose a singlylinkedlist.

Constructor & Destructor Documentation

◆ singlylinkedlistnode()

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

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

◆ ~singlylinkedlistnode()

template<class valuetype>
singlylinkedlistnode< valuetype >::~singlylinkedlistnode ( )

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

Member Function Documentation

◆ compare() [1/2]

template<class valuetype>
int32_t singlylinkedlistnode< valuetype >::compare ( valuetype  value) const

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

◆ compare() [2/2]

template<class valuetype>
int32_t singlylinkedlistnode< valuetype >::compare ( singlylinkedlistnode< valuetype > *  peer) const

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

◆ getNext()

template<class valuetype>
singlylinkedlistnode<valuetype>* singlylinkedlistnode< valuetype >::getNext ( )

Returns the next node in the singlylinkedlist or NULL if this node is the last node in the list.

◆ getValue()

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

Return the value stored in the node.

◆ print()

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

Prints the value stored in the node.

◆ setValue()

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

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