Direct Known Satisfying Classes: LazyMap<Key,Item>, 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 Entrys, 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";
Attributes
hashSource 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
inverseSource 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.

keysSource Code
shared actual default Set<Key> keys

Returns the set of keys contained in this Map.

Refined declaration: keys
valuesSource 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
Attributes inherited from: Cloneable<Clone>
Attributes inherited from: Collection<Element>
Attributes inherited from: Correspondence<Key,Item>
Attributes inherited from: Iterable<Element,Absent>
Methods
equalsSource 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 Entrys 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
mapItemsSource 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
Methods inherited from: Correspondence<Key,Item>
Methods inherited from: Iterable<Element,Absent>