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";
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 Refined declaration: hash |
inverse | Source Code Returns a |
keys | Source Code Returns the set of keys contained in this Refined declaration: keys |
values | Source Code Returns all the values stored in this |
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 | |
equals | Source Code Two Refined declaration: equals |
mapItems | Source Code Returns a Parameters:
|
Inherited Methods |
Methods inherited from: Category |
Methods inherited from: Correspondence<Key,Item> |
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 |