class List
MyCpp::Referenced
MyCpp::Object
MyCpp::List

Bidirectional linked list.

Data fields
Element *firstPointer to the first element of the list, or NULL.
Element *lastPointer to the last element of the list, or NULL.

Methods
unsigned long
getNumElements ()
Returns the number of elements currently in the list.
void
appendEmpty (Element *element)
Appends an element to the list.
void
append (const T &data, Element *element)
Appends an element to the specified element of list, initializing the element's data field with a specified value.
void
prepend (T &data, Element *element)
Prepends an element to the specified element of the list, initializing the element's data field with a specified value.
void
remove (Element *element)
Removes an element from the list.
void
clear ()
Clears the list, i.e. removes all elements from it.
getNumElements

Returns the number of elements currently in the list.

unsigned long getNumElements ()
appendEmpty

Appends an element to the list.

After the completion of this method a new element will be inserted right after the specified element.

A default constructor must exist for type T.

void appendEmpty (Element *element)
element :  The element after which the new element is to be inserted.
append

Appends an element to the specified element of list, initializing the element's data field with a specified value.

The element's value will be set using the copy constructor for type T.

void append (const T &data, Element *element)
data :  The value to be assigned to the data field of the newly created element.
element :  The element after which the new element is to be inserted.
prepend

Prepends an element to the specified element of the list, initializing the element's data field with a specified value.

The element's value will be set using the copy constructor for type T.

void prepend (T &data, Element *element)
data :  The value to be assigned to the data field of the newly created element.
element :  The element before which the new element is to be inserted.
remove

Removes an element from the list.

void remove (Element *element)
element :  The element to be removed from the list.
clear

Clears the list, i.e. removes all elements from it.

void clear ()