A container class that uses a hash table to map key objects to value objects.
More...
|
| HashMap () |
| Create a hash map with the default load factor and number of buckets. More...
|
|
| HashMap (Float newLoadFactor) |
| Create a hash map with the specified load factor and default number of buckets. More...
|
|
| HashMap (HashType newNumBuckets) |
| Create a hash map with the default load factor and specified number of buckets. More...
|
|
| HashMap (HashType newNumBuckets, Float newLoadFactor) |
| Create a hash map with the specified load factor and number of buckets. More...
|
|
| HashMap (const HashMap &other) |
| Create a hash map with the specified load factor and number of buckets. More...
|
|
HashMap & | operator= (const HashMap &other) |
| Copy the contents of one hash map into another. More...
|
|
| ~HashMap () |
| Destroy a hash map and it's contents, deallocating all memory used. More...
|
|
V * | add (HashType keyHash, const K &key, const V &value) |
| Add a new mapping to the hash map, associating the given key with the given value. More...
|
|
Bool | set (HashType keyHash, const K &key, const V &value) |
| Set the mapping of a key to be the given value, regardless of it's previous state. More...
|
|
Bool | remove (HashType keyHash, const K &key) |
| Remove the first mapping of the given key. More...
|
|
Bool | removeAll (HashType keyHash, const K &key) |
| Remove the all mappings for the given key. More...
|
|
Bool | remove (HashType keyHash, const K &key, const V &value) |
| Remove a specific key-value mapping from the hash map. More...
|
|
void | clear () |
| Clear all mappings from the hash map. More...
|
|
Bool | find (HashType keyHash, const K &key, V *&value) |
| Query whether or not the specified key is contained in a hash map. More...
|
|
Bool | find (HashType keyHash, const K &key, const V *&value) const |
| Query whether or not the specified key is contained in a hash map. More...
|
|
Bool | contains (HashType keyHash, const K &key) const |
| Query whether or not the specified key is contained in a hash map. More...
|
|
Bool | contains (HashType keyHash, const K &key, const V &value) const |
| Query whether or not a particular mapping exists in the hash map. More...
|
|
SizeType | getSize () const |
| Return the number of mappings in a hash map. More...
|
|
Bool | isEmpty () const |
| Return whether or not a hash map is empty. More...
|
|
V * | get (HashType keyHash, const K &key) |
| Return a pointer to the value associated with the given key. More...
|
|
const V * | get (HashType keyHash, const K &key) const |
| Return a const pointer to the value associated with the given key. More...
|
|
Iterator | getIterator () |
| Return an iterator for the hash map that can modify the hash map. More...
|
|
ConstIterator | getIterator () const |
| Return a const-iterator for the hash map. More...
|
|
BucketIterator | getBucketIterator (HashType keyHash) |
| Return an iterator for the bucket associated with the specified key hash code. More...
|
|
ConstBucketIterator | getBucketIterator (HashType keyHash) const |
| Return an iterator for the bucket associated with the specified key hash code. More...
|
|
void | setLoadFactor (Float newLoadFactor) |
|
Float | getLoadFactor () const |
|
template<typename K, typename V, typename HashType = Hash, typename SizeType = Size>
class om::util::HashMap< K, V, HashType, SizeType >
A container class that uses a hash table to map key objects to value objects.
template<typename K, typename V, typename HashType = Hash, typename SizeType = Size>
V* om::util::HashMap< K, V, HashType, SizeType >::add |
( |
HashType |
keyHash, |
|
|
const K & |
key, |
|
|
const V & |
value |
|
) |
| |
|
inline |
Add a new mapping to the hash map, associating the given key with the given value.
If the add operation was successful, it returns a pointer to the location where the mapping's value is stored. Otherwise, a NULL pointer is returned.