Skip to content

Std collections map

std:std.collections.Map

Class Map#

The Map class provides support for associative maps.

A map is a container style object that provides a mechanism for associating 'key' objects with 'value' objects. This is done using an internal node object that contains a reference to both a key and a value, along with information about the node' s location within the map.

Each key in a map occurs exactly once - a map cannot contain multiple equivalent keys.

Maps can handle inserting, removing and finding keys in 'O(log2)' time. That is, the time needed to insert, remove or find a key is proportional to log2 of the number of items in the map.

Structs
Iterator
KeyIterator
MapKeys
MapValues
ValueIterator
Classes
Node The map Node class.
Constructors
New Creates a new empty map.
Properties
Empty Checks if the map is empty. (read only)
Keys Gets a view of the map's keys. (read only)
Values Gets a view of the map's values. (read only)
Methods
Add Adds a new key/value pair to a map.
All Gets a node iterator.
Clear Removes all keys from the map.
Contains Checks if the map contains a given key.
Copy
Count Gets the number of keys in the map.
Get Gets the value associated with a key in the map.
Remove Removes a key from the map.
Set Sets the value associated with a key in the map.
Update Updates the value associated with a key in the map.
Operator [] Gets the value associated with a key in the map.
Operator []= Sets the value associated with a key in the map.