Interface MapView<K, V>
A read-only view of the standard "Map" abstract data type, which stores key/value pairs such that no
key appears more than once in the collection. Given a key, a MapView
will return the corresponding
value, and generally does so very quickly (constant or log n
time, depending on the
implementation).
- Source Code:
- View Source
Field Summary
count :Int - The number of key/value pairs the map contains.
keys :Iterator<K> - An iterator which returns all of the keys in the map.
values :Iterator<V> - An iterator which returns all of the values in the map.
entries :Iterator<(frost.collections.MapView.K, frost.collections.MapView.V)> - An iterator which returns all of the (key, value) pairs in the map.
Instance Method Summary
-- index operator --
[] (key :
):K V? - Returns the value mapped to the given key, or
null
if no such mapping exists. contains (key :
):K Bit - Returns
true
if the map contains the given key (even if the value it maps to isnull
)
Fields
The number of key/value pairs the map contains.
An iterator which returns all of the keys in the map.
An iterator which returns all of the values in the map. Because multiple keys may map to the same value, this iterator may return duplicate values.
An iterator which returns all of the (key, value) pairs in the map.
Instance Methods
Returns the value mapped to the given key, or null
if no such mapping exists. If the map's
type permits null
values, this function does not distinguish between cases where the map does
not contain the given key, and cases where it does contain the key, but it maps to null
. The
contains
method can be used to disambiguate this situation.
- Parameters:
-
- value of typekey K