21#ifndef __LOUT_CONTAINER_HH_
22#define __LOUT_CONTAINER_HH_
166 {
int pos =
bsearch (newElement,
false, comparator);
167 insert (newElement, pos);
return pos; }
179 {
return bsearch (key, mustExist, 0,
size () - 1, comparator); }
230 {
return remove0(element,
false,
false); }
232 {
return remove0(element,
true,
false); }
234 {
return remove0(element,
false,
true); }
407 { this->base = it2.
base;
return *
this; }
409 { this->base = it2.
base;
return *
this; }
449 inline Vector(
int initSize,
bool ownerOfObjects) {
452 inline void put(T *newElement,
int newPos = -1)
454 inline void insert(T *newElement,
int pos)
462 inline T *
get(
int pos)
const
468 inline int bsearch(T *key,
bool mustExist,
int start,
int end,
487 inline List(
bool ownerOfObjects)
519 inline HashSet(
bool owner,
int tableSize = 251)
522 inline void put(T *
object)
538 inline HashTable(
bool ownerOfKeys,
bool ownerOfValues,
int tableSize = 251)
542 inline void put(K *key, V *value)
544 inline V *
get(K *key)
const
Abstract base class template for all container objects in container::typed.
bool equals(Object *other)
Returns, whether two objects are equal.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
untyped::Collection * base
int hashValue()
Return a hash value for the object.
Typed version of container::untyped::HashSet.
bool contains(T *object) const
HashSet(bool owner, int tableSize=251)
Typed version of container::untyped::HashTable.
void put(K *key, V *value)
HashTable(bool ownerOfKeys, bool ownerOfValues, int tableSize=251)
Typed version of container::untyped::Iterator.
Iterator(Iterator< T > &it2)
Iterator & operator=(const Iterator< T > &it2)
Iterator & operator=(Iterator< T > &it2)
Iterator(const Iterator< T > &it2)
Typed version of container::untyped::List.
bool removeRef(T *element)
bool insertBefore(object::Object *beforeThis, object::Object *neew)
List(bool ownerOfObjects)
bool detachRef(T *element)
Typed version of container::untyped::Stack.
void pushUnder(T *object)
Stack(bool ownerOfObjects)
Typed version of container::untyped::Vector.
void put(T *newElement, int newPos=-1)
int bsearch(T *key, bool mustExist, object::Comparator *comparator=&object::standardComparator)
Vector(int initSize, bool ownerOfObjects)
void insert(T *newElement, int pos)
int bsearch(T *key, bool mustExist, int start, int end, object::Comparator *comparator=&object::standardComparator)
void sort(object::Comparator *comparator=&object::standardComparator)
int insertSorted(T *newElement, object::Comparator *comparator=&object::standardComparator)
The base class for all iterators, as created by container::untyped::Collection::createIterator.
virtual Object * getNext()=0
virtual AbstractIterator * createIterator()=0
Abstract base class for all container objects in container::untyped.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
Node * insertNode(object::Object *object)
void put(object::Object *object)
bool remove(object::Object *key)
bool contains(object::Object *key) const
virtual Node * createNode()
virtual void clearNode(Node *node)
AbstractIterator * createIterator()
Node * findNode(object::Object *object) const
int calcHashValue(object::Object *object) const
object::Object * get(object::Object *key) const
void clearNode(Node *node)
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
void put(object::Object *key, object::Object *value)
This is a small wrapper for AbstractIterator, which may be used directly, not as a pointer,...
Iterator(Collection0::AbstractIterator *impl)
Collection0::AbstractIterator * impl
object::Object * getNext()
Iterator & operator=(const Iterator &it2)
ListIterator(List::Node *node)
bool remove0(object::Object *element, bool compare, bool doNotDeleteAtAll)
bool equals(Object *other)
Returns, whether two objects are equal.
void append(object::Object *element)
object::Object * getLast() const
bool removeRef(object::Object *element)
AbstractIterator * createIterator()
bool insertBefore(object::Object *beforeThis, object::Object *neew)
bool remove(object::Object *element)
object::Object * getFirst() const
int hashValue()
Return a hash value for the object.
bool detachRef(object::Object *element)
StackIterator(Stack::Node *node)
void push(object::Object *object)
void pushUnder(object::Object *object)
AbstractIterator * createIterator()
object::Object * getTop() const
VectorIterator(Vector *vector)
Container, which is implemented by an array, which is dynamically resized.
void sort(object::Comparator *comparator=&object::standardComparator)
Sort the elements in the vector.
int insertSorted(object::Object *newElement, object::Comparator *comparator=&object::standardComparator)
Insert into an already sorted vector.
void put(object::Object *newElement, int newPos=-1)
int bsearch(Object *key, bool mustExist, int start, int end, object::Comparator *comparator=&object::standardComparator)
Use binary search to find an element in a sorted vector.
int bsearch(Object *key, bool mustExist, object::Comparator *comparator=&object::standardComparator)
object::Object * get(int pos) const
AbstractIterator * createIterator()
void insert(object::Object *newElement, int pos)
A class for fast concatenation of a large number of strings.
Used for other orders as the one defined by Comparable.
This is the base class for many other classes, which defines very common virtual methods.
virtual int hashValue()
Return a hash value for the object.
virtual bool equals(Object *other)
Returns, whether two objects are equal.
StandardComparator standardComparator