HashMap
Object Hierarchy:
Description:
public class HashMap<K,V> :
AbstractMap<
K?,
V?>
Hash table implementation of the Map interface.
This implementation is better fit for highly heterogenous key values. In case of high key hashes redundancy or higher amount of data
prefer using tree implementation like TreeMap.
See also:
TreeMap
Namespace: Gee
Package: gee-1.0
Content:
Creation methods:
Properties:
-
public override int
size { get; }
The number of items in this map.
-
public override
Set<K?>
keys { owned
get; }
The read-only view of the keys of this map.
-
public override
Collection<V?>
values { owned
get; }
The read-only view of the values of this map.
-
public override
Set<
Entry<K?,
V?>> entries {
owned get; }
The read-only view of the entries of this map.
-
public HashFunc
key_hash_func { private
set; get; }
The keys' hash function.
-
public EqualFunc
key_equal_func { private
set; get; }
The keys' equality testing function.
-
public EqualFunc
value_equal_func { private
set; get; }
The values' equality testing function.
Methods:
-
public override bool
has_key (K? key)
Determines whether this map has the specified key.
-
public override bool
has (K? key,
V? value)
Determines whether this map has the specified key/value entry.
-
public override V?
get (K? key)
Returns the value of the specified key in this map.
-
public override void
set (K? key,
V? value)
Inserts a new key and value into this map.
-
public override bool
unset (K? key,
out V? value = null)
Removes the specified key from this map.
-
public override void
clear ()
Removes all items from this collection. Must not be called on read-only collections.
-
public override
MapIterator<K?,
V?> map_iterator ()
Returns an iterator for this map.