Constructor
new MapWithCapacity(capacity)
Parameters:
Name | Type | Description |
---|---|---|
capacity |
number |
- Source:
Classes
Methods
adjustSize()
Adjusts the size of the underlying map, so it will fit the capacity.
- Source:
removeFirstAdded()
Removes the earliest item added to the map.
- Source:
set(key, value)
Associates supplied value with the provided key.
If the capacity was reached, earliest item added to this map will be removed.
Unlike with the standard `Map`, the latest set item will always be emitted
last by the iterables, even in case it was already added and then overriden.
Parameters:
Name | Type | Description |
---|---|---|
key |
||
value |
- Source: