#include <list.h>
Public Member Functions | |
List () | |
List (const List< T > &) throw ( bad_alloc ) | |
~List () | |
unsigned | size () const |
void | clear () |
bool | empty () const |
void | push_back (const T &) throw ( bad_alloc ) |
void | push_front (const T &) throw ( bad_alloc ) |
T | pop_front () throw ( ListEmpty ) |
T | pop_back () throw ( ListEmpty ) |
T & | getFront () const throw ( ListEmpty ) |
T & | getCurrent () const throw ( ListEmpty ) |
T & | getBack () const throw ( ListEmpty ) |
void | insertBeforeCurrent (const T &) throw ( ListEmpty, bad_alloc ) |
void | insertAfterCurrent (const T &) throw ( ListEmpty, bad_alloc ) |
T | removeCurrent () throw ( ListEmpty ) |
void | setToFront () throw ( ListEmpty ) |
void | setToBack () throw ( ListEmpty ) |
void | moveForward () throw ( ListEmpty ) |
void | moveBackward () throw ( ListEmpty ) |
bool | find (const T &) throw ( ListEmpty ) |
bool | atFront () const throw ( ListEmpty ) |
bool | atBack () const throw ( ListEmpty ) |
const List< T > & | operator= (const List< T > &) throw ( bad_alloc) |
|
Default constructor. |
|
Copy constructor.
|
|
Class destructor. |
|
Returns true if current is at the back of the list; Returns false otherwise.
|
|
Returns true if current is at the front of the list; Returns false otherwise.
|
|
Removes the elements in the list. |
|
Returns true if the list is empty; returns false otherwise.
|
|
Returns true if the object is found in the list, and sets current to point to the node containing the found item; Returns false otherwise, leaving current unaltered.
|
|
Gets, but does not remove, the object at the back of the list. Current is left unchanged.
|
|
Gets, but does not remove, the object pointed to by current.
|
|
Gets, but does not remove, the object at the front of the list. Current is left unchanged.
|
|
Inserts the object after the node pointed to by current. Sets current to point to the new node.
|
|
Inserts the object before the node pointed to by current. Sets current to point to the new node.
|
|
Move current to the previous node in the list. If current points to the front of the list, then current is left unchanged.
|
|
Moves current to the next node in the list. If current points to the end of the list, then current is left unchanged.
|
|
Returns a deep copy of the list passed in as the parameter.
|
|
Removes and returns the object at the back of the list. If current points to the back of the list, then sets current to point to the new back of the list. Otherwise, current is left unchanged.
|
|
Removes and returns the object at the front of the list. If current points to the front of the list, then sets current to point to the new front of the list. Otherwise, current is left unchanged.
|
|
Adds the object to the back of the list. After adding, sets current to the new node.
|
|
Adds the object to the front of the list. After adding, sets current to the new node.
|
|
Removes and returns the object in the node pointed to by current. Sets current to the next node, if possible. Otherwise, it sets current to the previous node.
|
|
Sets current to the last node in the list.
|
|
Sets current to the first node in the list.
|
|
Returns the size (i.e., number of elements) of the list.
|