Represents a collection which maps keys to items, where a key can map to at most one item. Each such mapping may be represented by an `Entry`.

A `Map` is a `Collection` of its `Entry`s, and a `Correspondence` from keys to items.

The presence of an entry in a map may be tested using the `in` operator:

    if ("lang"->"en_AU" in settings) { ... }

The entries of the map may be iterated using `for`:

    for (key->item in settings) { ... }

The item for a key may be obtained using the item operator:

    String lang = settings["lang"] else "en_US";

Keys are compared for equality using `Object.equals()` or `Comparable.compare()`. There may be at most one entry per key.

See also `Entry`, `forKey()`, `forItem()`, `byItem()`, `byKey()`

no type hierarchy

- `Map`
  - `Collection`
    - `Iterable`
      - `Category`
  - `Correspondence`

- `Map`
  - `emptyMap`

Attributes
`hash` | Source Code `shared actual default Integer hash` The hash value of the value, which allows the value to be an element of a hash-based set or key of a hash-based map. Implementations must respect the constraint that: if `x==y` then `x.hash==y.hash`. Therefore, a class which refines `Object.equals()` must also refine `hash`. Refines `Object.hash`
`items` | Source Code `shared default Collection<Item> items` A `Collection` containing the items stored in this map. An element can be stored under more than one key in the map, and so it can occur more than once in the resulting collection.
`keys` | Source Code `shared actual default Collection<Key> keys` A `Collection` containing the keys of this map. Refines `Correspondence.keys`

Inherited Attributes
Attributes inherited from: `Object` `Object.string`
Attributes inherited from: `Collection<Element>` `Collection.string`
Attributes inherited from: `Correspondence<Key,Item>` `Correspondence.keys`
Attributes inherited from: `Iterable<Element,Absent>` `Iterable.coalesced`, `Iterable.cycled`, `Iterable.empty`, `Iterable.exceptLast`, `Iterable.first`, `Iterable.indexed`, `Iterable.last`, `Iterable.paired`, `Iterable.rest`, `Iterable.size`, `Iterable.string`

Methods
`clone` | Source Code `shared formal Map<Key,Item> clone()` A shallow copy of this collection, that is, a collection with identical elements which does not change if this collection changes. If this collection is immutable, it is acceptable to return a reference to this collection. If this collection is mutable, a newly instantiated collection must be returned. Refines `Collection.clone`
`contains` | Source Code `shared actual default Boolean contains(Object entry)` Determines if the given value is an `Entry` belonging to this map. See also `defines()` Refines `Collection.contains` ultimately refines `Category.contains`
`defines` | Source Code `shared formal Boolean defines(Object key)` Determines if there is an entry in this map with the given `key`. See also `contains()` Refines `Correspondence.defines`
`equals` | Source Code `shared actual default Boolean equals(Object that)` Two maps are considered equal iff they have the same entry sets. The entry set of a `Map` is the set of `Entry`s belonging to the map. Therefore, the maps are equal iff they have same set of `keys`, and for every key in the key set, the maps have equal items. Refines `Object.equals`
`filterKeys` | Source Code `shared default Map<Key,Item> filterKeys(Boolean filtering(Key key))` Produces a map by applying a `filtering()` function to the `keys` of this map. This is a lazy operation, returning a view of this map. Parameters: `filtering` The predicate function that filters the keys of this map, determining if there is a corresponding entry in the resulting map.
`get` | Source Code `shared formal Item? get(Object key)` Returns the item of the entry with the given `key`, or `null` if there is no entry with the given `key` in this map. Refines `Correspondence.get`
`mapItems` | Source Code `shared default Map<Key,Result> mapItems<Result>(Result mapping(Key key, Item item)) given Result satisfies Object` Produces a map with the same `keys` as this map. For every key, the item is the result of applying the given transformation function to its associated item in this map. This is a lazy operation, returning a view of this map. Parameters: `mapping` The function that transforms a key/item pair of this map, producing the item of the resulting map.
`patch` | Source Code `shared default Map<Key|OtherKey,Item|OtherItem> patch<OtherKey, OtherItem>(Map<OtherKey,OtherItem> other) given OtherKey satisfies Object given OtherItem satisfies Object` Produces a map whose keys are the union of the keys of this map, with the keys of the given map. For any given key in the resulting map, its associated item is the item associated with the key in the given map, if any, or the item associated with the key in this map otherwise. That is, for any `key` in the resulting patched map:
    map.patch(other)[key] == other[key] else map[key]
This is a lazy operation producing a view of this map and the given map.

Inherited Methods
Methods inherited from: `Category<Element>` `Category.contains()`, `Category.containsAny()`, `Category.containsEvery()`
Methods inherited from: `Collection<Element>` `Collection.clone()`
Methods inherited from: `Correspondence<Key,Item>` `Correspondence.defines()`, `Correspondence.definesAny()`, `Correspondence.definesEvery()`, `Correspondence.get()`, `Correspondence.getAll()`
Methods inherited from: `Iterable<Element,Absent>` `Iterable.any()`, `Iterable.by()`, `Iterable.chain()`, `Iterable.collect()`, `Iterable.count()`, `Iterable.defaultNullElements()`, `Iterable.every()`, `Iterable.filter()`, `Iterable.find()`, `Iterable.findLast()`, `Iterable.flatMap()`, `Iterable.fold()`, `Iterable.follow()`, `Iterable.getFromFirst()`, `Iterable.interpose()`, `Iterable.iterator()`, `Iterable.longerThan()`, `Iterable.map()`, `Iterable.max()`, `Iterable.partition()`, `Iterable.product()`, `Iterable.reduce()`, `Iterable.repeat()`, `Iterable.scan()`, `Iterable.select()`, `Iterable.sequence()`, `Iterable.shorterThan()`, `Iterable.skip()`, `Iterable.skipWhile()`, `Iterable.sort()`, `Iterable.spread()`, `Iterable.take()`, `Iterable.takeWhile()`