HashMap< K, V > Class Template Reference

#include <rimPhysicsHashMap.h>

List of all members.

Public Member Functions

 HashMap ()
 HashMap (float newLoadFactor)
 HashMap (Hash newNumBuckets)
 HashMap (Hash newNumBuckets, float newLoadFactor)
 ~HashMap ()
void add (Hash keyHash, const K &key, const V &value)
void set (Hash keyHash, const K &key, const V &value)
remove (Hash keyHash, const K &key)
bool remove (Hash keyHash, const K &key, const V &value)
void clear ()
bool contains (Hash keyHash, const K &key) const
bool containsSimilarKey (Hash keyHash, const K &key, bool(*areSimilar)(const K &, const K &)) const
bool contains (Hash keyHash, const K &key, const V &value) const
Size getSize () const
bool isEmpty () const
V & get (Hash keyHash, const K &key) const
V & getSimilar (Hash keyHash, const K &key, bool(*areSimilar)(const K &, const K &)) const
K & getSimilarKey (Hash keyHash, const K &key, bool(*areSimilar)(const K &, const K &)) const
Iterator getIterator () const
void setLoadFactor (float newLoadFactor)
float getLoadFactor () const

Private Member Functions

void add (Entry *entry)
void checkLoadFactor ()
Hash getBucketIndex (Hash hash) const
void resize (Hash newNumBuckets)
void initialize (Hash newNumBuckets)
void deallocate ()

Static Private Member Functions

static Hash nextPrime (Hash n)

Private Attributes

ArrayList< Entry * > * buckets
Hash numBuckets
Size numElements
float loadFactor

Static Private Attributes

static const Hash DEFAULT_NUMBER_OF_BUCKETS = 19
static const int NUMBER_OF_PRIMES = 28
static const Hash PRIMES [NUMBER_OF_PRIMES]
static const float DEFAULT_LOAD_FACTOR = 0.5f

Classes

class  Entry
class  Iterator

template<typename K, typename V>
class HashMap< K, V >


Constructor & Destructor Documentation

template<typename K, typename V>
HashMap< K, V >::HashMap (  )  [inline]

template<typename K, typename V>
HashMap< K, V >::HashMap ( float  newLoadFactor  )  [inline]

template<typename K, typename V>
HashMap< K, V >::HashMap ( Hash  newNumBuckets  )  [inline]

template<typename K, typename V>
HashMap< K, V >::HashMap ( Hash  newNumBuckets,
float  newLoadFactor 
) [inline]

template<typename K, typename V>
HashMap< K, V >::~HashMap (  )  [inline]


Member Function Documentation

template<typename K, typename V>
void HashMap< K, V >::add ( Hash  keyHash,
const K &  key,
const V &  value 
) [inline]

template<typename K, typename V>
void HashMap< K, V >::set ( Hash  keyHash,
const K &  key,
const V &  value 
) [inline]

template<typename K, typename V>
V HashMap< K, V >::remove ( Hash  keyHash,
const K &  key 
) [inline]

template<typename K, typename V>
bool HashMap< K, V >::remove ( Hash  keyHash,
const K &  key,
const V &  value 
) [inline]

template<typename K, typename V>
void HashMap< K, V >::clear (  )  [inline]

template<typename K, typename V>
bool HashMap< K, V >::contains ( Hash  keyHash,
const K &  key 
) const [inline]

template<typename K, typename V>
bool HashMap< K, V >::containsSimilarKey ( Hash  keyHash,
const K &  key,
bool(*)(const K &, const K &)  areSimilar 
) const [inline]

template<typename K, typename V>
bool HashMap< K, V >::contains ( Hash  keyHash,
const K &  key,
const V &  value 
) const [inline]

template<typename K, typename V>
Size HashMap< K, V >::getSize (  )  const [inline]

template<typename K, typename V>
bool HashMap< K, V >::isEmpty (  )  const [inline]

template<typename K, typename V>
V& HashMap< K, V >::get ( Hash  keyHash,
const K &  key 
) const [inline]

template<typename K, typename V>
V& HashMap< K, V >::getSimilar ( Hash  keyHash,
const K &  key,
bool(*)(const K &, const K &)  areSimilar 
) const [inline]

template<typename K, typename V>
K& HashMap< K, V >::getSimilarKey ( Hash  keyHash,
const K &  key,
bool(*)(const K &, const K &)  areSimilar 
) const [inline]

template<typename K, typename V>
Iterator HashMap< K, V >::getIterator (  )  const [inline]

template<typename K, typename V>
void HashMap< K, V >::setLoadFactor ( float  newLoadFactor  )  [inline]

template<typename K, typename V>
float HashMap< K, V >::getLoadFactor (  )  const [inline]

template<typename K, typename V>
void HashMap< K, V >::add ( Entry entry  )  [inline, private]

template<typename K, typename V>
void HashMap< K, V >::checkLoadFactor (  )  [inline, private]

template<typename K, typename V>
Hash HashMap< K, V >::getBucketIndex ( Hash  hash  )  const [inline, private]

template<typename K, typename V>
void HashMap< K, V >::resize ( Hash  newNumBuckets  )  [inline, private]

template<typename K, typename V>
void HashMap< K, V >::initialize ( Hash  newNumBuckets  )  [inline, private]

template<typename K, typename V>
void HashMap< K, V >::deallocate (  )  [inline, private]

template<typename K, typename V>
static Hash HashMap< K, V >::nextPrime ( Hash  n  )  [inline, static, private]


Member Data Documentation

template<typename K, typename V>
ArrayList<Entry*>* HashMap< K, V >::buckets [private]

template<typename K, typename V>
Hash HashMap< K, V >::numBuckets [private]

template<typename K, typename V>
Size HashMap< K, V >::numElements [private]

template<typename K, typename V>
float HashMap< K, V >::loadFactor [private]

template<typename K, typename V>
const Hash HashMap< K, V >::DEFAULT_NUMBER_OF_BUCKETS = 19 [static, private]

template<typename K, typename V>
const int HashMap< K, V >::NUMBER_OF_PRIMES = 28 [static, private]

template<typename K, typename V>
const Hash HashMap< K, V >::PRIMES [inline, static, private]

template<typename K, typename V>
const float HashMap< K, V >::DEFAULT_LOAD_FACTOR = 0.5f [inline, static, private]


The documentation for this class was generated from the following file:
Generated on Tue Aug 26 00:03:20 2008 for Rim Physics by  doxygen 1.5.4