Dillo
|
A single-linked list. More...
#include <container.hh>
Classes | |
class | ListIterator |
struct | Node |
Public Member Functions | |
List (bool ownerOfObjects) | |
~List () | |
bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
int | hashValue () |
Return a hash value for the object. More... | |
int | size () |
void | clear () |
void | append (object::Object *element) |
bool | insertBefore (object::Object *beforeThis, object::Object *neew) |
bool | removeRef (object::Object *element) |
bool | remove (object::Object *element) |
bool | detachRef (object::Object *element) |
int | size () const |
bool | isEmpty () const |
object::Object * | getFirst () const |
object::Object * | getLast () const |
Public Member Functions inherited from lout::container::untyped::Collection | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
Iterator | iterator () |
Public Member Functions inherited from lout::object::Object | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual Object * | clone () |
Return an exact copy of the object. More... | |
const char * | toString () |
Use object::Object::intoStringBuffer to return a textual representation of the object. More... | |
virtual size_t | sizeOf () |
Return the number of bytes, this object totally uses. More... | |
Protected Member Functions | |
AbstractIterator * | createIterator () |
Private Member Functions | |
bool | remove0 (object::Object *element, bool compare, bool doNotDeleteAtAll) |
Private Attributes | |
Node * | first |
Node * | last |
bool | ownerOfObjects |
int | numElements |
Friends | |
class | ListIterator |
A single-linked list.
lout::container::untyped::List::List | ( | bool | ownerOfObjects | ) |
lout::container::untyped::List::~List | ( | ) |
void lout::container::untyped::List::append | ( | object::Object * | element | ) |
void lout::container::untyped::List::clear | ( | ) |
References lout::container::untyped::List::Node::next.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
|
inline |
References remove0().
|
virtual |
Returns, whether two objects are equal.
The caller should ensure, that this and the object have the same class; this makes casting of "other" safe. Typically, an implementation should check this == other first, the caller can assume a fast implementation.
Reimplemented from lout::object::Object.
References lout::object::Object::equals(), first, lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.
|
inline |
References lout::container::untyped::List::Node::object.
|
inline |
References lout::container::untyped::List::Node::object.
|
virtual |
Return a hash value for the object.
Reimplemented from lout::object::Object.
References lout::object::Object::hashValue(), lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.
bool lout::container::untyped::List::insertBefore | ( | object::Object * | beforeThis, |
object::Object * | neew | ||
) |
|
inline |
|
inline |
References remove0().
|
private |
References lout::object::Object::equals(), lout::container::untyped::List::Node::next, and lout::container::untyped::List::Node::object.
Referenced by detachRef(), remove(), and removeRef().
|
inline |
References remove0().
|
virtual |
Implements lout::container::untyped::Collection.
|
inline |
References numElements.
|
friend |
|
private |
|
private |
Referenced by size().
|
private |