Struct ImmutableOrderedDictionary<TKey, TValue>
An immutable dictionary that iterates over elements in the
order they were added.
Implements
System.Collections.Immutable.IImmutableDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyCollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>>
System.Collections.IEnumerable
Inherited Members
System.ValueType.Equals(System.Object)
System.ValueType.GetHashCode()
System.ValueType.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
Assembly: Flame.Compiler.dll
Syntax
public struct ImmutableOrderedDictionary<TKey, TValue> : IImmutableDictionary<TKey, TValue>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name |
Description |
TKey |
|
TValue |
|
Fields
|
Improve this Doc
View Source
Empty
An empty immutable ordered dictionary.
Declaration
public static readonly ImmutableOrderedDictionary<TKey, TValue> Empty
Field Value
Properties
|
Improve this Doc
View Source
Count
Gets the number of elements in this dictionary.
Declaration
public int Count { get; }
Property Value
Type |
Description |
System.Int32 |
|
|
Improve this Doc
View Source
Item[TKey]
Gets the value for a particular key.
Declaration
public TValue this[TKey key] { get; }
Parameters
Type |
Name |
Description |
TKey |
key |
The key to look up.
|
Property Value
|
Improve this Doc
View Source
Keys
Gets a sequence of all keys in this dictionary.
Declaration
public IEnumerable<TKey> Keys { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<TKey> |
|
|
Improve this Doc
View Source
Values
Gets a sequence of all values in this dictionary.
Declaration
public IEnumerable<TValue> Values { get; }
Property Value
Type |
Description |
System.Collections.Generic.IEnumerable<TValue> |
|
Methods
|
Improve this Doc
View Source
Add(TKey, TValue)
Adds a key-value pair to this ordered dictionary.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> Add(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
The key to add to the dictionary.
|
TValue |
value |
The value to associate with key .
|
Returns
|
Improve this Doc
View Source
AddRange(IEnumerable<KeyValuePair<TKey, TValue>>)
Adds a sequence of key-value pairs to this ordered dictionary.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
pairs |
The key-value pairs to add to the dictionary.
|
Returns
|
Improve this Doc
View Source
Clear()
Creates an immutable ordered dictionary that does not contain
any elements.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> Clear()
Returns
|
Improve this Doc
View Source
Contains(KeyValuePair<TKey, TValue>)
Tests if this dictionary contains a particular key-value pair.
Declaration
public bool Contains(KeyValuePair<TKey, TValue> pair)
Parameters
Type |
Name |
Description |
System.Collections.Generic.KeyValuePair<TKey, TValue> |
pair |
The key-value pair to look for.
|
Returns
Type |
Description |
System.Boolean |
true if this dictionary contains the key-value pair;
otherwise, false .
|
|
Improve this Doc
View Source
ContainsKey(TKey)
Tests if this dictionary contains a particular key.
Declaration
public bool ContainsKey(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
The key to look for.
|
Returns
Type |
Description |
System.Boolean |
true if this dictionary contains the key;
otherwise, false .
|
|
Improve this Doc
View Source
GetEnumerator()
Declaration
public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
Returns
Type |
Description |
System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
|
|
Improve this Doc
View Source
Remove(TKey)
Removes a key-value pair from this immutable ordered dictionary.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> Remove(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
The key of the key-value pair to remove.
|
Returns
|
Improve this Doc
View Source
RemoveRange(IEnumerable<TKey>)
Removes a sequence of key-value pairs from this immutable ordered dictionary.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> RemoveRange(IEnumerable<TKey> keys)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TKey> |
keys |
The keys of the key-value pairs to remove.
|
Returns
|
Improve this Doc
View Source
SetItem(TKey, TValue)
Assigns a value to a particular key.
Declaration
public ImmutableOrderedDictionary<TKey, TValue> SetItem(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
The key to assign a value to.
|
TValue |
value |
The value to assign to the key.
|
Returns
|
Improve this Doc
View Source
SetItems(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
public ImmutableOrderedDictionary<TKey, TValue> SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
items |
The key-value pairs to add or update.
|
Returns
|
Improve this Doc
View Source
ToBuilder()
Creates a mutable version of this immutable ordered dictionary.
Declaration
public ImmutableOrderedDictionary<TKey, TValue>.Builder ToBuilder()
Returns
|
Improve this Doc
View Source
TryGetKey(TKey, out TKey)
Declaration
public bool TryGetKey(TKey equalKey, out TKey actualKey)
Parameters
Type |
Name |
Description |
TKey |
equalKey |
|
TKey |
actualKey |
|
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
TryGetValue(TKey, out TValue)
Declaration
public bool TryGetValue(TKey key, out TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Boolean |
|
Explicit Interface Implementations
|
Improve this Doc
View Source
IEnumerable.GetEnumerator()
Declaration
IEnumerator IEnumerable.GetEnumerator()
Returns
Type |
Description |
System.Collections.IEnumerator |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.Add(TKey, TValue)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Add(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.AddRange(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.AddRange(IEnumerable<KeyValuePair<TKey, TValue>> pairs)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
pairs |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.Clear()
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Clear()
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.Remove(TKey)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.Remove(TKey key)
Parameters
Type |
Name |
Description |
TKey |
key |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.RemoveRange(IEnumerable<TKey>)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.RemoveRange(IEnumerable<TKey> keys)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<TKey> |
keys |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.SetItem(TKey, TValue)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.SetItem(TKey key, TValue value)
Parameters
Type |
Name |
Description |
TKey |
key |
|
TValue |
value |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
|
Improve this Doc
View Source
IImmutableDictionary<TKey, TValue>.SetItems(IEnumerable<KeyValuePair<TKey, TValue>>)
Declaration
IImmutableDictionary<TKey, TValue> IImmutableDictionary<TKey, TValue>.SetItems(IEnumerable<KeyValuePair<TKey, TValue>> items)
Parameters
Type |
Name |
Description |
System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<TKey, TValue>> |
items |
|
Returns
Type |
Description |
System.Collections.Immutable.IImmutableDictionary<TKey, TValue> |
|
Implements
System.Collections.Immutable.IImmutableDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
System.Collections.Generic.IReadOnlyCollection<T>
System.Collections.Generic.IEnumerable<T>
System.Collections.IEnumerable