- IIMapper<K, V>
Remarks
A defaultValue can be set that is returned for keys that don't have an explicit value set.
It is legal to use null as key, which can be assigned a value just like other keys.
Type Parameters
K
V
See Also
Developer's Guide
Members
Constructors
Creates an instance using a HashMap<K, V> as the backing store.
null item is stored separately.Parameters
- defaultValue?: V
- The value to return if no specific value has been set for a given key.
Creates an instance using the provided HashMap<K, V> as the backing store.
null item is stored separately.Parameters
- dictionary: any
- The IMap<TKey, TValue> to use as backing store.
- defaultValue?: V
- The value to return if no specific value has been set for a given key.
Properties
See Also
Developer's Guide
Gets an enumerable over all entries in this (dictionary-based) mapper.
Methods
Calls clear on the backing implementation.
Setting a value for an already existing key overwrites the previous value.
It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides a way to remove a mapping, that should be preferred over setting a null value. For example, Mapper<K, V> provides the delete method.
Parameters
- key: K
- The key of the mapping.
Return Value
- V
- The value.
Implements
IMapper.getSetting a value for an already existing key overwrites the previous value.
It depends on the specific implementation of the mapper whether a mapping can be removed. If an implementation provides a way to remove a mapping, that should be preferred over setting a null value. For example, Mapper<K, V> provides the delete method.
Parameters
- key: K
- The key of the mapping.
- value: V
- The value.