dillo
3.0.5
About: dillo is a small, fast, extensible Web browser particularly suitable for older or smaller computers and embedded systems (but only limited or no support for frames, CSS, JavaScript, Java).
![]() ![]() |
Container, which is implemented by an array, which is dynamically resized. More...
#include <container.hh>
Classes | |
class | VectorIterator |
Public Member Functions | |
Vector (int initSize, bool ownerOfObjects) | |
~Vector () | |
void | put (object::Object *newElement, int newPos=-1) |
void | insert (object::Object *newElement, int pos) |
void | insertSorted (object::Object *newElement) |
Insert into an already sorted vector. More... | |
void | remove (int pos) |
object::Object * | get (int pos) const |
int | size () |
void | clear () |
void | sort () |
int | bsearch (Object *key, bool mustExist) |
Use binary search to find an element in a sorted vector. More... | |
![]() | |
void | intoStringBuffer (misc::StringBuffer *sb) |
Store a textual representation of the object in a misc::StringBuffer. More... | |
Iterator | iterator () |
![]() | |
virtual | ~Object () |
The destructor is defined as virtual (but not abstract), so that destruction of Object's works properly. More... | |
virtual bool | equals (Object *other) |
Returns, whether two objects are equal. More... | |
virtual int | hashValue () |
Return a hash value for the object. 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 Attributes | |
object::Object ** | array |
int | numAlloc |
int | numElements |
bool | ownerOfObjects |
Friends | |
class | VectorIterator |
Container, which is implemented by an array, which is dynamically resized.
Definition at line 103 of file container.hh.
lout::container::untyped::Vector::Vector | ( | int | initSize, |
bool | ownerOfObjects | ||
) |
Definition at line 104 of file container.cc.
lout::container::untyped::Vector::~Vector | ( | ) |
Definition at line 112 of file container.cc.
int lout::container::untyped::Vector::bsearch | ( | Object * | key, |
bool | mustExist | ||
) |
Use binary search to find an element in a sorted vector.
If "mustExist" is true, only exact matches are found; otherwise, -1 is returned. If it is false, the position of the next greater element is returned, or, if the key is the greatest element, the size of the array. (This is the value which can be used for insertion; see insertSortet()).
Definition at line 205 of file container.cc.
Referenced by insertSorted().
void lout::container::untyped::Vector::clear | ( | ) |
Definition at line 146 of file container.cc.
|
protectedvirtual |
Implements lout::container::untyped::Collection0.
Definition at line 258 of file container.cc.
|
inline |
Definition at line 144 of file container.hh.
References array, and numElements.
void lout::container::untyped::Vector::insert | ( | object::Object * | newElement, |
int | pos | ||
) |
Definition at line 157 of file container.cc.
Referenced by insertSorted().
|
inline |
Insert into an already sorted vector.
Notice that insertion is not very efficient, unless the position is rather at the end.
Definition at line 140 of file container.hh.
void lout::container::untyped::Vector::put | ( | object::Object * | newElement, |
int | newPos = -1 |
||
) |
Definition at line 118 of file container.cc.
void lout::container::untyped::Vector::remove | ( | int | pos | ) |
Definition at line 177 of file container.cc.
|
inline |
Definition at line 146 of file container.hh.
References numElements.
void lout::container::untyped::Vector::sort | ( | ) |
Sort the elements in the vector. Assumes that all elements are Comparable's.
Definition at line 191 of file container.cc.
References lout::object::Comparable::compareFun().
|
friend |
Definition at line 105 of file container.hh.
|
private |
Definition at line 108 of file container.hh.
Referenced by get().
|
private |
Definition at line 109 of file container.hh.
|
private |
Definition at line 109 of file container.hh.
|
private |
Definition at line 110 of file container.hh.