jcpp::ResourceHash Class Reference

#include <ResourceHash.h>

Inheritance diagram for jcpp::ResourceHash:

Inheritance graph
[legend]
Collaboration diagram for jcpp::ResourceHash:

Collaboration graph
[legend]

List of all members.

Public Member Functions

CDELETE ResourceHash (char *filename)
int size ()
boolean isEmpty ()
StringEnumerationkeys ()
StringEnumerationelements ()
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 ()
Objectclone ()
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


Detailed Description

How to write a lousy hash class, by Ben Allan, 7/99. Note this used to have string template class dependencies that have been removed.

Member Function Documentation

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.


Member Data Documentation

int jcpp::ResourceHash::N [private]

geometry; the index to a primes list.


The documentation for this class was generated from the following file:

Generated on Tue Apr 28 03:13:02 2009 for CCAFFEINE by  doxygen 1.5.5