Main Page   Class Hierarchy   Alphabetical List   Compound List   Compound Members  

util::DoublyLinkedList< content > Class Template Reference

#include <LinkedList.h>

Inheritance diagram for util::DoublyLinkedList< content >:

util::LinkedList< content > util::Object List of all members.

Detailed Description

template<class content>
class util::DoublyLinkedList< content >

Doubly linked list is an stronger version of the basic linked list.

It features bidirectional links and can thus be searched in two directions.


Public Methods

 DoublyLinkedList (void)
 Create an unlinked node.

 DoublyLinkedList (const content &obj)
 Create an unlinked node with the given contents.

void setNext (DoublyLinkedList *node)
 Set the next node for this node.

void setNext (LinkedList< content > *node)
 Calls setNext(DoublyLinkedList*).

void insertAfter (DoublyLinkedList *node)
 Insert a sequence of nodes after this node.

void insertAfter (LinkedList< content > *node)
 Calls insertAfter(DoublyLinkedList*).

void remove ()
 Remove this node from a linked list.

const DoublyLinkedList * getFirstElement (void) const
 Get the first element in this list.

DoublyLinkedList * getFirstElement (void)
 Get the first element in this list.


Protected Attributes

DoublyLinkedList * _pPrevious
 A pointer to the previous element in a sequence.


Member Function Documentation

template<class content>
DoublyLinkedList* util::DoublyLinkedList< content >::getFirstElement void    [inline]
 

Get the first element in this list.

The sequence is seeked backwards until "getPrevious" returns NULL.

Returns:
the first node in a sequence

template<class content>
const DoublyLinkedList* util::DoublyLinkedList< content >::getFirstElement void    const [inline]
 

Get the first element in this list.

The sequence is seeked backwards until "getPrevious" returns NULL.

Returns:
the first node in a sequence

template<class content>
void util::DoublyLinkedList< content >::insertAfter DoublyLinkedList< content > *    node
 

Insert a sequence of nodes after this node.

Node is set to be the "next" for this node, and the last item in the linked list node is set to be the "previous" of the current "next" node.

Parameters:
node  the linked list that is to be inserted after this node

template<class content>
void util::DoublyLinkedList< content >::setNext DoublyLinkedList< content > *    node
 

Set the next node for this node.

The internal pointer to the next node and the "previous" pointer in node are updated.

Parameters:
node  the node to be set as the "next" node


The documentation for this class was generated from the following file:
Documentation generated on 11.09.2003 with Doxygen.
The documentation is copyrighted material.
Copyright © Topi Mäenpää 2003. All rights reserved.