smjg.libs.util.hashmap.THashMap< K, V >.Map Class Reference

The Map class implements an associative container. More...

List of all members.

Public Member Functions

opIndex (K k)
 Looks up a value.
opIndexAssign (V v, K k)
 Sets a value.
bool contains (K k)
 Check whether a key is contained.
remove (K k)
 Removes an entry.
Map rehash ()
 Rehashes the array in place.
int opApply (int public(*dg)(inout V))
 Iterates over the values in the map.
int opApply (int public(*dg)(inout K, inout V))
 Iterates over the keys and values in the map.


Detailed Description

The Map class implements an associative container.

Unlike the current implementation of D's built-in associative arrays, this doesn't rely on an ordering comparator, so it will work even if the key type has no ordering or unequal objects can rank equally in order.


Member Function Documentation

V smjg.libs.util.hashmap.THashMap< K, V >.Map.opIndex ( k  ) 

Looks up a value.

Implementation of this[k].

Parameters:
k key to look up.
Returns:
the corresponding value.

V smjg.libs.util.hashmap.THashMap< K, V >.Map.opIndexAssign ( v,
k 
)

Sets a value.

Implementation of this[k] = v.

Parameters:
k key to set.
v value to assign to key.
Returns:
v.

bool smjg.libs.util.hashmap.THashMap< K, V >.Map.contains ( k  ) 

Check whether a key is contained.

Parameters:
k key to check.
Returns:
true if the key is contained, otherwise false.

V smjg.libs.util.hashmap.THashMap< K, V >.Map.remove ( k  ) 

Removes an entry.

Parameters:
k key to remove.
Returns:
the value associated with the removed key.
Return values:
V.init if the key was not present.

Map smjg.libs.util.hashmap.THashMap< K, V >.Map.rehash (  ) 

Rehashes the array in place.

Returns:
the array.

int smjg.libs.util.hashmap.THashMap< K, V >.Map.opApply ( int public(*)(inout V)  dg  ) 

Iterates over the values in the map.

(Implementation of foreach(V; Map).)

Modifying the map while foreach is in progress, other than by an inout value variable in the foreach loop, currently leads to undefined behaviour.

int smjg.libs.util.hashmap.THashMap< K, V >.Map.opApply ( int public(*)(inout K, inout V)  dg  ) 

Iterates over the keys and values in the map.

(Implementation of foreach(K, V; Map).)

Modifying the map while foreach is in progress, other than by an inout value variable in the foreach loop, currently leads to undefined behaviour.


The documentation for this class was generated from the following file:
Generated on Sun Sep 13 19:50:38 2009 for Stewart's Utility Library by  doxygen 1.5.4