ImmutableLinkedHashMap<K, V> Class

This class implements the IImmutableDictionary<TKey, TValue> interface. It has ImmutableDictionary<TKey, TValue> and ImmutableArray<T> to maintain the elements so that it has predictable iteration order, like that of the LinkedHashMap class in Java.

C#
public sealed class ImmutableLinkedHashMap<K, V> : IImmutableDictionary<K, V>
where K : notnull

Type Parameters

K
notnull

The type of keys maintained by this dictionary.

V

The type of mapped values.

Inheritance
ImmutableLinkedHashMap<K, V>
Implements

Remarks

The ImmutableArray<T> keeps the iteration order corresponding to the in which you insert key-value pairs into the map. Note that the insertion order is not affected when you re-inserted any key into it (i.e., with the SetItem(K, V) method).

Fields

Properties

Methods

Explicit Interface Implementations

Fields Detail

Empty

C#
public static readonly ImmutableLinkedHashMap<K, V> Empty

Field Value

Properties Detail

Keys

C#
public IEnumerable<K> Keys { get; }

Property Value

Implements

Values

C#
public IEnumerable<V> Values { get; }

Property Value

Implements

Count

C#
public int Count { get; }

Property Value

int

Implements

this[K]

C#
public V this[K key] { get; }

Property Value

V

Implements

Methods Detail

Add(K, V)

C#
public IImmutableDictionary<K, V> Add(K key, V value)

Parameters

key
K
value
V

Returns

Implements

AddRange(IEnumerable<KeyValuePair<K, V>>)

C#
public IImmutableDictionary<K, V> AddRange(IEnumerable<KeyValuePair<K, V>> pairs)

Parameters

Returns

Implements

Clear()

C#
public IImmutableDictionary<K, V> Clear()

Returns

Implements

Contains(KeyValuePair<K, V>)

C#
public bool Contains(KeyValuePair<K, V> pair)

Parameters

Returns

Implements

ContainsKey(K)

C#
public bool ContainsKey(K key)

Parameters

key
K

Returns

Implements

GetEnumerator()

C#
public IEnumerator<KeyValuePair<K, V>> GetEnumerator()

Returns

Implements

Remove(K)

C#
public IImmutableDictionary<K, V> Remove(K key)

Parameters

key
K

Returns

Implements

RemoveRange(IEnumerable<K>)

C#
public IImmutableDictionary<K, V> RemoveRange(IEnumerable<K> keys)

Parameters

Returns

Implements

SetItem(K, V)

C#
public IImmutableDictionary<K, V> SetItem(K key, V value)

Parameters

key
K
value
V

Returns

Implements

SetItems(IEnumerable<KeyValuePair<K, V>>)

C#
public IImmutableDictionary<K, V> SetItems(IEnumerable<KeyValuePair<K, V>> items)

Parameters

Returns

Implements

TryGetKey(K, K)

C#
public bool TryGetKey(K equalKey, out K actualKey)

Parameters

equalKey
K
actualKey
K

Returns

Implements

TryGetValue(K, V)

C#
public bool TryGetValue(K key, out V value)

Parameters

key
K
value
V

Returns

Implements

Explicit Interface Implementations Detail

IEnumerable.GetEnumerator()

C#
private IEnumerator IEnumerable.GetEnumerator()

Returns

Implements