Satisfied Interfaces: Category, Cloneable<Map<Key,Item>>, Collection<Key->Item>
, Correspondence<Object,Item>, Iterable<Element,Null>
Direct Known Satisfying Classes: LazyMap<Key,Item>, emptyMap
All Known Subtypes Hierarchy

- Map
  - LazyMap
  - emptyMap

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";

See also: Entry, forKey, forItem, byItem, byKey

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`. Refined declaration: hash
inverse | Source Code shared default Map<Item,Set<Key>> inverse Returns a `Map` in which every key is an `Item` in this map, and every value is the set of keys that stored the `Item` in this map.
keys | Source Code shared actual default Set<Key> keys Returns the set of keys contained in this `Map`. Refined declaration: keys
values | Source Code shared default Collection<Item> values Returns all the values stored in this `Map`. An element can be stored under more than one key in the map, and so it can be contained more than once in the resulting collection.

Inherited Attributes
Attributes inherited from: Object string
Attributes inherited from: Cloneable<Clone> clone
Attributes inherited from: Collection<Element> string
Attributes inherited from: Correspondence<Key,Item> keys
Attributes inherited from: Iterable<Element,Absent> coalesced, cycled, empty, first, indexed, last, rest, sequence, size, string

Methods
equals | Source Code shared actual default Boolean equals(Object that) Two `Map`s 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. Refined declaration: equals
mapItems | Source Code shared default Map<Key,Result> mapItems<Result>(Result mapping(Key key, Item item)) given Result satisfies Object Returns a `Map` with the same keys as this map. For every key, the item is the result of applying the given transformation function. Parameters: mapping The function that transforms a key/item pair, producing the item of the resulting map.

Inherited Methods
Methods inherited from: Category contains, containsAny, containsEvery
Methods inherited from: Correspondence<Key,Item> defines, definesAny, definesEvery, get, items
Methods inherited from: Iterable<Element,Absent> any, by, chain, collect, count, cycle, defaultNullElements, every, filter, find, findLast, fold, following, iterator, longerThan, map, repeat, select, shorterThan, skipping, skippingWhile, sort, taking, takingWhile