SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform::Containers
Template Class HashMap

GeneralContainerType
   |
   +-GeneralDictionaryType
        |
        +-HashMap

Implemented in:
Platform.Containers.HashMap.h

template <typename Key, typename Value, typename Tester = Lang::TypeActors::EqualityTester<Key>, typename Hasher = Lang::TypeActors::Hasher<Key>>
class HashMap:
public GeneralDictionaryType

A dynamically sized, unordered, associative hash map container.

See Also:
Containers

Inner Compounds, Typedefs, and Enumscollapse
typedef EqualityTesterType
          The type of the equality tester function.
typedef HasherType
          The type of the hash function.
typedef KeyType
          The type of the keys within the map.
typedef ValueType
          The type of the values within this map.

Inner Compounds, Typedefs, and Enums inherited from class GeneralDictionaryTypecollapse
ConstEnumerator, ConstIterator, Entry, EntryType, Enumerator, Iterator

Fields inherited from class GeneralContainerTypecollapse
base

Constructor Summarycollapse
HashMap()
          Creates an empty hash map.
HashMap(const HashMap& container)
          Creates a copy of an existing hash map.
template <typename ContainerX>
HashMap(const ContainerX& container)

          Creates a new hash map and copies the elements from the specified container using its enumerator.
HashMap(Int capacity)
          Creates an empty hash map with the specified initial capacity.
HashMap(Int capacity, Float loadFactor)
          Creates an empty hash map with the specified initial capacity and load factor.
~HashMap()
          Destructor.

Method Summarycollapse
template <typename Collection,
typename Predicate>
Collection&
collectEntries(Collection& collection, Predicate function) const
          DOCTODO.
Pair<Key,
Value>
extractFirst()
          DOCTODO.
Pair<Key,
Value>
extractLast()
          DOCTODO.
EntryType first()
          DOCTODO.
const EntryType first() const
          DOCTODO.
EntryType last()
          DOCTODO.
const EntryType last() const
          DOCTODO.
HashMap& operator=(const HashMap& container)
          DOCTODO.
Void removeFirst()
          DOCTODO.
Void removeLast()
          DOCTODO.

Methods inherited from class GeneralContainerTypecollapse
compareTo, deepSize, empty, equals, exchangeWith, hashCode, isEmpty, size, toString, toXml

Methods inherited from class GeneralDictionaryTypecollapse
add, addAll, addAll, containsAll, containsAll, containsAllKeys, containsKey, containsValue, get, get, get, put, put, putAll, putAll, remove, remove, toString

Friend Summarycollapse
friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const HashMap& container)
          Serializes the state of a HashMap object.
friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, HashMap& container)
          Deserializes the state of a HashMap object.

 

Constructor Detail

HashMap[inline]

HashMap()

Creates an empty hash map.


HashMap[inline]

HashMap(const HashMap& container)

Creates a copy of an existing hash map.

Parameters:
container - an existing hash map to make a copy of

HashMap[explicit, inline]

template <typename ContainerX>
HashMap(const ContainerX& container)

Creates a new hash map and copies the elements from the specified container using its enumerator.

Parameters:
container - a container to copy elements from

HashMap[explicit, inline]

HashMap(Int capacity)

Creates an empty hash map with the specified initial capacity.

Parameters:
capacity - the initial capacity specified in the number of elements
Preconditions:
the specified capacity must be > 0

HashMap[explicit, inline]

HashMap(Int capacity, Float loadFactor)

Creates an empty hash map with the specified initial capacity and load factor.

Parameters:
capacity - the initial capacity specified in the number of elements
loadFactor - the load factor
Preconditions:
the specified capacity must be > 0 the specified loadFactor must be > 0 && <= 1

~HashMap[inline]

~HashMap()

Destructor.

 

Method Detail

collectEntries[inline]

template <typename Collection, typename Predicate>
Collection& collectEntries(Collection& collection, Predicate function) const

DOCTODO.

Parameters:
collection - DOCTODO
function - DOCTODO
Returns:
DOCTODO

extractFirst[inline]

Pair<Key, Value> extractFirst()

DOCTODO.

Returns:
DOCTODO

extractLast[inline]

Pair<Key, Value> extractLast()

DOCTODO.

Returns:
DOCTODO

first[inline]

EntryType first()

DOCTODO.

Returns:
DOCTODO

first[inline]

const EntryType first() const

DOCTODO.

Returns:
DOCTODO

last[inline]

EntryType last()

DOCTODO.

Returns:
DOCTODO

last[inline]

const EntryType last() const

DOCTODO.

Returns:
DOCTODO

operator=[inline]

HashMap& operator=(const HashMap& container)

DOCTODO.

Parameters:
container - DOCTODO
Returns:
DOCTODO

removeFirst[inline]

Void removeFirst()

DOCTODO.


removeLast[inline]

Void removeLast()

DOCTODO.

 

Friend Detail

operator<<[inline]

friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const HashMap& container)

Serializes the state of a HashMap object.

Parameters:
container - a hash map object to serialize
serializer - a serializer to receive state data
Returns:
the reference to the serializer

operator>>[inline]

friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, HashMap& container)

Deserializes the state of a HashMap object.

Parameters:
container - a hash map object to deserialize
deserializer - a deserializer to retrieve state data from
Returns:
the reference to the deserializer


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND