#include <list.h>
Public Member Functions | |
List () | |
~List () | |
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 | atFront () const throw ( ListEmpty ) |
bool | atBack () const throw ( ListEmpty ) |
|
Default class 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.; return false otherwise.
|
|
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.
|
|
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.
|