#include <ResourceHash.h>
Public Member Functions | |
CDELETE | ResourceHash (char *filename) |
int | size () |
boolean | isEmpty () |
StringEnumeration * | keys () |
StringEnumeration * | elements () |
boolean | contains (char *value) |
boolean | containsKey (char *key) |
CFREE char ** | charKeysToArray (int &ka_length) |
char * | get (char *key) |
char * | put (const char *key, const char *value) |
CFREE char * | remove (char *key) |
void | clear () |
Object * | clone () |
CFREE char * | toString () |
boolean | containsValue (char *s) |
void | rehash (int &RehashError) |
Private Member Functions | |
int | calculateBucket (register const char *str) |
Private Attributes | |
ResourceBucket ** | table |
int | table_length |
int | N |
float | loadFactor |
int | numberOfKeys |
int | rehashLimit |
char ** | okeys |
char ** | oelements |
int jcpp::ResourceHash::calculateBucket | ( | register const char * | str | ) | [private] |
unlike kaffe's rather goofy hash table implementation, we're stealing ascends/tcls hash on string.
StringEnumeration* jcpp::ResourceHash::keys | ( | ) |
keys will be enumerated as (char *)
StringEnumeration* jcpp::ResourceHash::elements | ( | ) |
Values in the table
CFREE char** jcpp::ResourceHash::charKeysToArray | ( | int & | ka_length | ) |
create array of keys used in table. The array returned should be freed, but the keys in it should not. The keys will expire if the hashtable is destroyed. The array is nullterminated.
char* jcpp::ResourceHash::put | ( | const char * | key, | |
const char * | value | |||
) |
key/value will be copied if needed; the pointers given are not kept.
int jcpp::ResourceHash::N [private] |
geometry; the index to a primes list.