62 fprintf (stderr,
"Object::hashValue() should be implemented.\n");
98 sb->
append(
"<not further specified object ");
108 fprintf (stderr,
"Object::sizeOf() should be implemented.\n");
169#if SIZEOF_VOID_P == 4
178 return ((intptr_t)
value >> 32) ^ ((intptr_t)
value);
185 snprintf(buf,
sizeof(buf),
"%p",
value);
206 sprintf(buf,
"%d",
value);
221 bool value2 = ((
Boolean*)other)->value;
223 return (
value && value2) || (!
value && value2);
228 return value ? 1 : 0;
238 return (
value ? 1 : 0) - (((
Boolean*)other)->value ? 1 : 0);
250 (
str == NULL && otherString->
str == NULL) ||
251 (
str != NULL && otherString->
str != NULL &&
252 strcmp(
str, otherString->
str) == 0);
264 if (
str && otherString->
str)
265 return strcmp(
str, otherString->
str);
268 else if (otherString->
str)
279 for (
int i = 0;
str[i]; i++)
280 h = (h * 256 +
str[i]);
331 (
first == NULL && otherPair->
first == NULL) ||
A class for fast concatenation of a large number of strings.
void appendPointer(void *p)
void append(const char *str)
Append a NUL-terminated string to the buffer, with copying.
const char * getChars()
Return a NUL-terminated strings containing all appended strings.
An object::Object wrapper for bool's.
int compareTo(Comparable *other)
Compare two objects, this and other.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
int hashValue()
Return a hash value for the object.
bool equals(Object *other)
Returns, whether two objects are equal.
Instances of a sub class of may be compared (less, greater).
Used for other orders as the one defined by Comparable.
static int compareFun(const void *p1, const void *p2)
This static method may be used as compare function for qsort(3) and bsearch(3), for an array of Objec...
static Comparator * compareFunComparator
virtual int compare(Object *o1, Object *o2)=0
Compare two objects o1 and o2.
An object::Object wrapper for constant strings (char*).
int hashValue()
Return a hash value for the object.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
bool equals(Object *other)
Returns, whether two objects are equal.
int compareTo(Comparable *other)
Compare two objects, this and other.
An object::Object wrapper for int's.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
int compareTo(Comparable *other)
Compare two objects, this and other.
bool equals(Object *other)
Returns, whether two objects are equal.
int hashValue()
Return a hash value for the object.
This is the base class for many other classes, which defines very common virtual methods.
virtual Object * clone()
Return an exact copy of the object.
virtual size_t sizeOf()
Return the number of bytes, this object totally uses.
virtual ~Object()
The destructor is defined as virtual (but not abstract), so that destruction of Object's works proper...
virtual void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
const char * toString()
Use object::Object::intoStringBuffer to return a textual representation of the object.
virtual int hashValue()
Return a hash value for the object.
virtual bool equals(Object *other)
Returns, whether two objects are equal.
size_t sizeOf()
Return the number of bytes, this object totally uses.
int hashValue()
Return a hash value for the object.
void intoStringBuffer(misc::StringBuffer *sb)
Store a textual representation of the object in a misc::StringBuffer.
PairBase(Object *first, Object *second)
bool equals(Object *other)
Returns, whether two objects are equal.
An object::Object wrapper for void pointers.
int hashValue()
Return a hash value for the object.
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.
int compare(Object *o1, Object *o2)
Compare two objects o1 and o2.
An object::Object wrapper for strings (char*).
char * dStrdup(const char *s)
StandardComparator standardComparator