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
-
Immutable
Linked Hash Map<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
Empty |
Gets an empty ImmutableLinkedHashMap<K, V>. |
Properties
Methods
Add(K, V) | |
Add |
|
Clear() | |
Contains(Key |
|
Contains |
|
Get |
|
Remove(K) | |
Remove |
|
Set |
|
Set |
|
Try |
|
Try |
|
Equals(object) | (Inherited from object) |
GetHashCode() | (Inherited from object) |
GetType() | (Inherited from object) |
MemberwiseClone() | (Inherited from object) |
ToString() | (Inherited from object) |
Explicit Interface Implementations
Fields Detail
Empty
Gets an empty ImmutableLinkedHashMap<K, V>.
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
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
- pairs
-
IEnumerable<Key
Value >Pair<K, V>
Returns
Implements
Clear()
C#
public IImmutableDictionary<K, V> Clear()
Returns
Implements
Contains(KeyValuePair<K, V>)
C#
public bool Contains(KeyValuePair<K, V> pair)
Parameters
- pair
-
Key
Value Pair<K, V>
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
- keys
- IEnumerable<K>
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
- items
-
IEnumerable<Key
Value >Pair<K, V>
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()