seal::LinkedList< T > Class Template Reference

#include <list.h>

Inheritance diagram for seal::LinkedList< T >:

seal::List< T > seal::Collection< T >

List of all members.

Public Member Functions

 LinkedList (void)
 LinkedList (const LinkedList< T > &l)
virtual ~LinkedList ()
virtual bool isEmpty (void) const
virtual unsigned int size (void) const
virtual AbstractIterator< T > * iteratorPtr (void) const
virtual LinkedList< T >::Iterator iterator (void) const
virtual void purge (void)
virtual void pushBack (const T element)
virtual void popBack (void)
virtual void pushFront (const T element)
virtual void popFront (void)
virtual void insert (const T element, unsigned int index)
virtual void remove (unsigned int index)
void operator= (const LinkedList< T > &l)
virtual T & first (void) throw (EmptyCollectionException)
virtual T & last (void) throw (EmptyCollectionException)
virtual const T & first (void) const throw (EmptyCollectionException)
virtual const T & last (void) const throw (EmptyCollectionException)
bool contains (const T element) const
bool removeFirstMatch (const T match)
bool replace (int i, const T element)
bool replaceAll (const T match, const T e)
bool replaceFirst (const T match, const T e)

Classes

class  Iterator


Detailed Description

template<typename T>
class seal::LinkedList< T >

A class which encapsulates a doubly-linked list.

Constructor & Destructor Documentation

template<typename T>
seal::LinkedList< T >::LinkedList ( void   )  [inline]

Default Constructor.

template<typename T>
seal::LinkedList< T >::LinkedList ( const LinkedList< T > &  l  )  [inline]

Copy constructor. It is only a reference copier. The new list and the old one share the same list elements.

template<typename T>
seal::LinkedList< T >::~LinkedList (  )  [inline, virtual]

Destructor.


Member Function Documentation

template<typename T>
bool seal::LinkedList< T >::isEmpty ( void   )  const [inline, virtual]

Returns true is the list is empty.

Implements seal::Collection< T >.

template<typename T>
virtual unsigned int seal::LinkedList< T >::size ( void   )  const [inline, virtual]

Returns the number of elements in the list.

Implements seal::Collection< T >.

template<typename T>
virtual AbstractIterator<T>* seal::LinkedList< T >::iteratorPtr ( void   )  const [inline, virtual]

Returns a pointer to the iterator of the linked list. This iterator iterates from the 'front' (or begining) of the linked list to the 'back' (or end). The client of this function should be responsible of deleting the returned iterator object using delete.

Implements seal::Collection< T >.

template<typename T>
virtual LinkedList<T>::Iterator seal::LinkedList< T >::iterator ( void   )  const [inline, virtual]

Returns an iterator of the linked list. This iterator iterates from the 'front' (or begining) of the linked list to the 'back' (or end).

template<typename T>
void seal::LinkedList< T >::purge ( void   )  [inline, virtual]

Destroys the linked list. The size of the list will become 0 after a call to the purge function.

Implements seal::Collection< T >.

template<typename T>
void seal::LinkedList< T >::pushBack ( const T  element  )  [inline, virtual]

Appends an element at the back end of the list.

Parameters:
element The element to be appended to the list.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::popBack ( void   )  [inline, virtual]

Pops an element from the back end of the list.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::pushFront ( const T  element  )  [inline, virtual]

Appends an element at the front end of the list.

Parameters:
element The element to be appended to the list.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::popFront ( void   )  [inline, virtual]

Pops an element from the front end of the list.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::insert ( const T  element,
unsigned int  index 
) [inline, virtual]

Inserts an element, at the specified index, in to the linked list. If the specified index is greater than or equal to the size of the list, then the element is appended to the back end of the list.

Parameters:
element The element to be inserted.
index The index at which the element should be inserted.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::remove ( unsigned int  index  )  [inline, virtual]

Removes the element at the specified index in the linked list. If the specified index is greater than or equal to the size of the list, then nothing is done.

Parameters:
index The element at this index will be removed from the list.

Implements seal::List< T >.

template<typename T>
void seal::LinkedList< T >::operator= ( const LinkedList< T > &  l  )  [inline]

Assignment operator. An assignment operation will only be a reference copier. The LHS and RHS will share the elements of the RHS after assignment.

template<typename T>
T & seal::LinkedList< T >::first ( void   )  throw (EmptyCollectionException) [inline, virtual]

Returns the first element in the list. Throws an seal::EmptyCollectionException if the list is empty.

Implements seal::Collection< T >.

template<typename T>
T & seal::LinkedList< T >::last ( void   )  throw (EmptyCollectionException) [inline, virtual]

Returns the last element in the list. Throws an seal::EmptyCollectionException if the list is empty.

Implements seal::Collection< T >.

template<typename T>
const T & seal::LinkedList< T >::first ( void   )  const throw (EmptyCollectionException) [inline, virtual]

Returns the first element in the list. Throws an seal::EmptyCollectionException if the list is empty.

Implements seal::Collection< T >.

template<typename T>
const T & seal::LinkedList< T >::last ( void   )  const throw (EmptyCollectionException) [inline, virtual]

Returns the last element in the list. Throws an seal::EmptyCollectionException if the list is empty.

Implements seal::Collection< T >.

template<typename T>
bool seal::LinkedList< T >::contains ( const T  element  )  const [inline]

Returns true if element exists in the list; Else returns false.

template<typename T>
bool seal::LinkedList< T >::removeFirstMatch ( const T  match  )  [inline]

Remove the first element which is equal to match from the list. Returns true if an element was removed from the list; Else returns false.

template<typename T>
bool seal::LinkedList< T >::replace ( int  i,
const T  element 
) [inline]

Replaces the element at the specified index into the linked list.

Parameters:
i The index of the element which has to be replaced.
element The new value of the element at index i.

template<typename T>
bool seal::LinkedList< T >::replaceAll ( const T  match,
const T  e 
) [inline]

Replaces all elements which match a specified value.

Parameters:
match The elements with this value are replaced.
e The new value of the elements with value \ match.

template<typename T>
bool seal::LinkedList< T >::replaceFirst ( const T  match,
const T  e 
) [inline]

Replaces the first element which matches the specified value.

Parameters:
match The elements with this value are replaced.
e The new value of the elements with value \ match.


The documentation for this class was generated from the following file:

Generated on Sat May 16 21:35:20 2009 for SEAL by  doxygen 1.5.5