Rudiments
|
Inherits listcollection< valuetype >.
Public Member Functions | |
linkedlist () | |
linkedlist (linkedlist< valuetype > &a) | |
linkedlist (nodecollection< valuetype > &a) | |
linkedlist< valuetype > & | operator= (linkedlist< valuetype > &a) |
linkedlist< valuetype > & | operator= (nodecollection< valuetype > &a) |
~linkedlist () | |
void | prepend (valuetype value) |
void | prepend (listnode< valuetype > *node) |
void | append (valuetype value) |
void | append (listnode< valuetype > *node) |
void | insertBefore (listnode< valuetype > *node, valuetype value) |
void | insertBefore (listnode< valuetype > *node, listnode< valuetype > *newnode) |
void | insertAfter (listnode< valuetype > *node, valuetype value) |
void | insertAfter (listnode< valuetype > *node, listnode< valuetype > *newnode) |
void | moveBefore (listnode< valuetype > *node, listnode< valuetype > *nodetomove) |
void | moveAfter (listnode< valuetype > *node, listnode< valuetype > *nodetomove) |
void | detach (listnode< valuetype > *node) |
bool | remove (valuetype value) |
bool | removeAll (valuetype value) |
bool | remove (listnode< valuetype > *node) |
uint64_t | getCount () |
listnode< valuetype > * | getFirst () |
listnode< valuetype > * | getLast () |
listnode< valuetype > * | getPrevious (listnode< valuetype > *node) |
listnode< valuetype > * | getNext (listnode< valuetype > *node) |
listnode< valuetype > * | find (valuetype value) |
listnode< valuetype > * | find (listnode< valuetype > *startnode, valuetype value) |
void | sortInexpensively () |
void | sortQuickly () |
bool | clear () |
Public Member Functions inherited from listcollection< valuetype > | |
listcollection () | |
listcollection (nodecollection< valuetype > &n) | |
virtual const char * | getType () |
virtual void | prepend (valuetype *values, uint64_t count) |
virtual void | append (valuetype *values, uint64_t count) |
virtual void | insertBefore (listnode< valuetype > *node, valuetype *values, uint64_t count) |
virtual void | insertAfter (listnode< valuetype > *node, valuetype *values, uint64_t count) |
virtual ssize_t | write () |
virtual ssize_t | write (output *out) |
virtual ssize_t | writeJson () |
virtual ssize_t | writeJson (bool indent) |
virtual ssize_t | writeJson (output *out) |
virtual ssize_t | writeJson (output *out, bool indent) |
Public Member Functions inherited from collection | |
collection () | |
collection (collection &c) | |
collection & | operator= (collection &c) |
virtual | ~collection () |
comparator * | getComparator () |
void | setComparator (comparator *newcomp) |
virtual bool | isReadOnly () |
virtual bool | isBlockBased () |
virtual uint64_t | getBlockSize () |
virtual bool | isSequentialAccess () |
virtual void | setManageValues (bool manage) |
virtual bool | getManageValues () |
virtual void | setManageArrayValues (bool manage) |
virtual bool | getManageArrayValues () |
virtual void | setManageKeys (bool manage) |
virtual bool | getManageKeys () |
virtual void | setManageArrayKeys (bool manage) |
virtual bool | getManageArrayKeys () |
Public Member Functions inherited from object | |
virtual | ~object () |
The linkedlist class allows you to store an arbitrary number of values in a doubly-linked list. Since the linkedlist class is template-based, you can store arbitrary types of values.
Each linkedlist is composed of a series of linkedlistnodes. Each linkedlistnode contains a value.
|
inline |
Creates an empty instance of the linkedlist class.
|
inline |
Creates an instance of the linkedlist class that is a copy of "a".
|
inline |
Creates an instance of the linkedlist class that is a copy of "a".
|
inline |
Deletes this instance of the linkedlist class and all of its linkedlistnodes.
The value stored in each linkedlistnode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
|
inlinevirtual |
Appends already created linkedlistnode "node" to the linkedlist.
Implements listcollection< valuetype >.
|
inlinevirtual |
Creates a new linkedlistnode containing "value" and appends it to the linkedlist.
Implements listcollection< valuetype >.
|
inlinevirtual |
Deletes all linkedlistnodes currently in the linkedlist.
The value stored in each linkedlistnode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Always returns true.
Implements collection.
|
inlinevirtual |
Detaches "node" from the list.
Implements listcollection< valuetype >.
|
inlinevirtual |
Returns a pointer to the first linkedlistnode after "startnode" containing "value" or NULL if "value" was not found.
Implements listcollection< valuetype >.
|
inlinevirtual |
Returns a pointer to the first linkedlistnode containing "value" or NULL if "value" was not found.
Implements listcollection< valuetype >.
|
inlinevirtual |
Returns the number of nodes in the linkedlist.
Implements collection.
|
inlinevirtual |
Returns the first node in the linkedlist.
Implements listcollection< valuetype >.
|
inline |
Returns the last node in the linkedlist.
|
inlinevirtual |
Returns the node after "node" or NULL if this node is the last node in the list. "node" is presumed to be in the list.
Implements listcollection< valuetype >.
|
inline |
Returns the node prior to "node" or NULL if this node is the first node in the list. "node" is presumed to be in the list.
|
inlinevirtual |
Inserts already created linkedlistnode "newnode" into the linkedlist after "node".
Implements listcollection< valuetype >.
|
inlinevirtual |
Creates a new linkedlistnode containing "value" and inserts it into the linkedlist after "node".
Implements listcollection< valuetype >.
|
inlinevirtual |
Inserts already created linkedlistnode "newnode" into the linkedlist before "node".
Implements listcollection< valuetype >.
|
inlinevirtual |
Creates a new linkedlistnode containing "value" and inserts it into the linkedlist before "node".
Implements listcollection< valuetype >.
|
inlinevirtual |
Moves node "nodetomove" to the position after "node" in the linkedlist.
Implements listcollection< valuetype >.
|
inlinevirtual |
Moves node "nodetomove" to the position before "node" in the linkedlist.
Implements listcollection< valuetype >.
|
inline |
Makes this instance of the linkedlist class identical to "a".
|
inline |
Makes this instance of the linkedlist class identical to "a".
|
inlinevirtual |
Prepends already created linkedlistnode "node" to the linkedlist.
Implements listcollection< valuetype >.
|
inlinevirtual |
Creates a new linkedlistnode containing "value" and prepends it to the linkedlist.
Implements listcollection< valuetype >.
|
inlinevirtual |
Removes linkedlistnode "node" from the linkedlist.
The value stored in the linkedlistnode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation does not require a search and is far less expensive than the remove(value) operation and removeAll().
Returns true on success and false on failure.
Implements listcollection< valuetype >.
|
inlinevirtual |
Deletes the first linkedlistnode containing "value".
The value stored in the linkedlistnode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation requires a search and is expensive in both execution time and code size.
Returns true on success and false on failure.
Implements listcollection< valuetype >.
|
inlinevirtual |
Deletes all linkedlistnodes containing "value".
The value stored in each linkedlistnode is only deleted if setManageValues(true) or setManageArrayValues(true) has been called.
Note that this operation requires a search and is expensive in both execution time and code size.
Returns true on success and false on failure.
Implements listcollection< valuetype >.
|
inlinevirtual |
Sorts the listcollection.
This sort is potentially much slower than sortQuickly() but uses no additional memory.
The order that the items are sorted into depends on the comparator that is being used, and how that comparator is configured. The default comparator, in its default configuration causes the list to be sorted in ascending order.
See collection::setComparator() and the comparator class for more detail.
Implements listcollection< valuetype >.
|
inlinevirtual |
Sorts the listcollection.
This sort is potentially much faster than sortInexpensively() but uses additional memory in proportion to the size of the list.
The order that the items are sorted into depends on the comparator that is being used, and how that comparator is configured. The default comparator, in its default configuration causes the list to be sorted in ascending order.
See collection::setComparator() and the comparator class for more detail.
Implements listcollection< valuetype >.