Home | Modules | Class Hierarchy | Alphabetical List | Compound List | Related Pages

HashtableCore< T > Class Template Reference
[Common interfaces]

Inheritance diagram for HashtableCore< T >:

Hashtable< T > HashtableWOnulls< T >

Detailed Description

template<class T>
class HashtableCore< T >

Common hashtable template.

Has no suppositions about templated object structure.


Public Methods

 HashtableCore ()
 Default constructor.

 HashtableCore (int capacity, double loadFactor=DEFAULT_LOAD_FACTOR)
 Constructor with explicit hashtable size declaration.

virtual ~HashtableCore ()
 Default Destructor.

bool put (const String *key, T value)
 Puts object into hashtable.

bool remove (const String *key)
 Removes object from hashtable.

const Stringkey (int index) const
 Enumerates hashtable keys.

void clear ()
 Clears hashtable.

int size () const
 Number of objects, currently stored in hashtable.


Protected Methods

void rehash ()
HashtableCore & operator= (HashtableCore &)

Protected Attributes

int csize
int capacity
double loadFactor
HashEntry< T > ** bucket


Constructor & Destructor Documentation

template<class T>
HashtableCore< T >::HashtableCore int    capacity,
double    loadFactor = DEFAULT_LOAD_FACTOR
 

Constructor with explicit hashtable size declaration.

Parameters:
capacity Initial capacity of Hashtable
loadFactor Initial loadFactor (0 < loadFactor < 1)


Member Function Documentation

template<class T>
bool HashtableCore< T >::put const String   key,
  value
 

Puts object into hashtable.

If such a key already exists, object is replaced.

template<class T>
bool HashtableCore< T >::remove const String   key
 

Removes object from hashtable.

If there is no record, associated with key, method does nothing.

template<class T>
const String * HashtableCore< T >::key int    index const
 

Enumerates hashtable keys.

Parameters:
index Internal index. Have to be less, than size()

template<class T>
void HashtableCore< T >::clear  
 

Clears hashtable.

Deletes all objects, stored in it.



Colorer Library version take5. Copyright © 1999-2003 Cail Lomecb.
Generated at Sun Mar 2 23:57:47 2003 by doxygen 1.3-rc2.