|
hoshi-lang dev
Yet another programming language
|
The hashMap standard library module provides a HashMap<K, V> struct for working with hash maps.
The HashMap<K, V> struct is a generic hash map implementation. The key type K must implement the Hashable interface.
constructor(): Creates a new, empty HashMap.static operator[](this: HashMap<K, V>, key: K) : V: Returns the value associated with the given key. Returns null if the key is not found.static operator[](value: V, this: HashMap<K, V>, key: K) : none: Inserts or updates a key-value pair.size() : int: Returns the number of key-value pairs in the hash map.clear() : none: Removes all key-value pairs from the hash map.keys() : K[]: Returns an array of all the keys in the hash map.values() : V[]: Returns an array of all the values in the hash map.contains(key: K) : bool: Returns true if the hash map contains the given key.remove(key: K) : none: Removes a key-value pair from the hash map.