Map

Description

class Tinman.Core.Collections.Map
<TKey>
<TValue>

Derived from

MapBase<TKey, TValue> abstract

An implementation of the IMap interface that uses a hashtable for storing the key/value pairs.

A specialized container may be created by subclassing Map and specifying a suitable EqualsDelegate and a suitable HashCodeDelegate in the constructor, optionally overriding the following methods to provide custom semantics:

Public / Constructors

Copy


public static method Copy → (3)

values in : IMapConst<TKey, TValue>

The values to copy or null to create an empty map.

equals opt : EqualsDelegate<TKey> = null

The equality predicate. If null, IMapConst.MethodEqualityKey of values in will be used, if possible. Otherwise, SystemUtil.EqualsDefault will be used.

hashCode opt : HashCodeDelegate<TKey> = null

The hashing method. If null, IMapConst.MethodHashCodeKey of values in will be used, if possible. Otherwise, SystemUtil.HashCodeDefault will be used.

returns → Map<TKey, TValue>

The created Map object.

Copies the given values in into a compact Map.

Map

3 overloads


public constructor Map1 → (1)

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Map.

The equality delegate is SystemUtil.EqualsDefault.
The hash code delegate is SystemUtil.HashCodeDefault.


public constructor Map2 → (2)

equals in : EqualsDelegate<TKey>

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Map.

The hash code delegate is SystemUtil.HashCodeDefault.


public constructor Map3 → (3)

equals in : EqualsDelegate<TKey>

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

hashCode in : HashCodeDelegate<TKey>

Optional hash code delegate. If null, SystemUtil.HashCodeDefault will be used.

capacity opt : int32 = 12

[>=0]
The initial capacity of the dictionary, in key/value pairs.

Creates a new instance of Map.

Wrap


[Pure]
public static method Wrap → (4)

key in : TKey

The map element key.

value in : TValue

The map element value.

equals opt : EqualsDelegate<TKey> = null

Optional equality comparer. If null, SystemUtil.EqualsDefault will be used.

hashCode opt : HashCodeDelegate<TKey> = null

Optional hash code delegate. If null, SystemUtil.HashCodeDefault will be used.

returns → Map<TKey, TValue>

The set.

Creates a compact map that initially holds the given element.

Public / Methods

Clear​Dirty


public method ClearDirty → ()

Removes all entries from this map, without setting the element keys and values to their defaults.