#include <LinkedList.h>
Inheritance diagram for util::LinkedList< content >:

Each object represents one node in the list. Each node is created initially unlinked, and deleting a node deletes all nodes following the deleted one.
Public Methods | |
| LinkedList (void) | |
| Create an unlinked node with the contents initialized to a default value. | |
| LinkedList (const content &obj) | |
| Create an unlinked node with the given contents. | |
| virtual | ~LinkedList () |
| Delete this node and all successors. | |
| LinkedList * | getNext (void) |
| Get a pointer to the next node in sequence. | |
| const LinkedList * | getNext (void) const |
| Get a const pointer to the next node in sequence. | |
| virtual void | setNext (LinkedList *node) |
| Set the next node for this node. | |
| virtual void | insertAfter (LinkedList *node) |
| Insert a linked list after this node. | |
| content | getData (void) const |
| Get the data stored in this node. | |
| content & | data (void) |
| Get a reference to the stored data. | |
| const content & | data (void) const |
| Get a const reference to the stored data. | |
| void | setData (const content &obj) |
| Set the data stored in this node. | |
| int | getLength (void) const |
| Get the number of nodes in a sequence. | |
| virtual LinkedList * | remove (LinkedList *node) |
| Remove a given node from the sequence following this node. | |
| virtual LinkedList * | remove (const content &obj) |
| Remove a given node from the sequence following this node. | |
| const LinkedList * | getLastElement (void) const |
| Get the last element in a linked list. | |
| LinkedList * | getLastElement (void) |
| Get the last element in a linked list. | |
Protected Attributes | |
| LinkedList * | _pNext |
| A pointer to the next element in sequence. | |
| content | _item |
| The data stored in this node. | |
|
||||||||||
|
Create an unlinked node with the given contents.
|
|
||||||||||
|
Get the data stored in this node.
|
|
||||||||||
|
Get the last element in a linked list. The sequence is seeked until getNext returns NULL.
|
|
||||||||||
|
Get the last element in a linked list. The sequence is seeked until getNext returns NULL.
|
|
||||||||||
|
Get the number of nodes in a sequence. If this node has no successors, the return value is one.
|
|
||||||||||
|
Get a const pointer to the next node in sequence.
|
|
||||||||||
|
Get a pointer to the next node in sequence.
|
|
||||||||||
|
Insert a linked list after this node. The whole list pointed by node is inserted after this node.
|
|
||||||||||
|
Remove a given node from the sequence following this node. The successors of the current node are searched until a node with contents equal to obj is found. The node is then removed from the list but not deleted.
|
|
||||||||||
|
Remove a given node from the sequence following this node. The successors of the current node are searched until node is found. The node is then removed from the list but not deleted.
|
|
||||||||||
|
Set the data stored in this node.
|
|
||||||||||
|
Set the next node for this node.
|