Export (0) Print
Expand All

ImmutableSortedDictionary<TKey, TValue> Class

Represents an immutable sorted dictionary.

NuGet package: Microsoft.Bcl.Immutable (about immutable collections and how to install)

System.Object
  System.Collections.Immutable.ImmutableSortedDictionary<TKey, TValue>

Namespace:  System.Collections.Immutable
Assembly:  System.Collections.Immutable (in System.Collections.Immutable.dll)

public sealed class ImmutableSortedDictionary<TKey, TValue> : IImmutableDictionary<TKey, TValue>, 
	IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, 
	IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, 
	IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, 
	IEnumerable

Type Parameters

TKey

The type of the key contained in the dictionary.

TValue

The type of the value contained in the dictionary.

The ImmutableSortedDictionary<TKey, TValue> type exposes the following members.

  NameDescription
Public propertyCountGets the number of key/value pairs in the immutable sorted dictionary.
Public propertyIsEmptyGets a value that indicates whether this instance of the immutable sorted dictionary is empty.
Public propertyItemGets the TValue associated with the specified key.
Public propertyKeyComparerGets the key comparer for the immutable sorted dictionary.
Public propertyKeysGets the keys in the immutable sorted dictionary.
Public propertyValueComparerGets the value comparer used to determine whether values are equal.
Public propertyValuesGets the values in the immutable sorted dictionary.
Top

  NameDescription
Public methodAddAdds an element with the specified key and value to the immutable sorted dictionary.
Public methodAddRangeAdds the specific key/value pairs to the immutable sorted dictionary.
Public methodClearRetrieves an empty immutable sorted dictionary that has the same ordering and key/value comparison rules as this dictionary instance.
Public methodContainsDetermines whether this immutable sorted dictionary contains the specified key/value pair.
Public methodContainsKeyDetermines whether this immutable sorted map contains the specified key.
Public methodContainsValueDetermines whether the immutable sorted dictionary contains an element with the specified value.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodGetEnumeratorReturns an enumerator that iterates through the immutable sorted dictionary.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodRemoveRemoves the element with the specified value from the immutable sorted dictionary.
Public methodRemoveRangeRemoves the elements with the specified keys from the immutable sorted dictionary.
Public methodSetItemSets the specified key and value in the immutable sorted dictionary, possibly overwriting an existing value for the given key.
Public methodSetItemsSets the specified key/value pairs in the immutable sorted dictionary, possibly overwriting existing values for the keys.
Public methodToBuilderCreates an immutable sorted dictionary with the same contents as this dictionary that can be efficiently mutated across multiple operations by using standard mutable interfaces.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodTryGetKeyDetermines whether this dictionary contains a specified key.
Public methodTryGetValueGets the value associated with the specified key.
Public methodWithComparers(IComparer<TKey>)Gets an instance of the immutable sorted dictionary that uses the specified key comparer.
Public methodWithComparers(IComparer<TKey>, IEqualityComparer<TValue>)Gets an instance of the immutable sorted dictionary that uses the specified key and value comparers.
Top

  NameDescription
Public Extension MethodToImmutableArray<KeyValuePair<TKey, TValue>> [This topic is preliminary and is subject to change.]
Creates an immutable array from the specified collection.
(Defined by ImmutableArray.)
Public Extension MethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey>(Func<KeyValuePair<TKey, TValue>, TKey>)Overloaded. Constructs an immutable dictionary from an existing collection of elements, applying a transformation function to the source keys. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey>(Func<KeyValuePair<TKey, TValue>, TKey>, IEqualityComparer<TKey>)Overloaded. Constructs an immutable dictionary based on some transformation of a sequence. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>)Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>, IEqualityComparer<TKey>)Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key comparer. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>, IEqualityComparer<TKey>, IEqualityComparer<TValue>)Overloaded. Enumerates and transforms a sequence, and produces an immutable dictionary of its contents by using the specified key and value comparers. (Defined by ImmutableDictionary.)
Public Extension MethodToImmutableHashSet<KeyValuePair<TKey, TValue>>()Overloaded. Enumerates a sequence and produces an immutable hash set of its contents. (Defined by ImmutableHashSet.)
Public Extension MethodToImmutableHashSet<KeyValuePair<TKey, TValue>>(IEqualityComparer<KeyValuePair<TKey, TValue>>)Overloaded. Enumerates a sequence, produces an immutable hash set of its contents, and uses the specified equality comparer for the set type. (Defined by ImmutableHashSet.)
Public Extension MethodToImmutableList<KeyValuePair<TKey, TValue>>Enumerates a sequence and produces an immutable list of its contents. (Defined by ImmutableList.)
Public Extension MethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>)Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents. (Defined by ImmutableSortedDictionary.)
Public Extension MethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>, IComparer<TKey>)Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key comparer. (Defined by ImmutableSortedDictionary.)
Public Extension MethodToImmutableSortedDictionary<KeyValuePair<TKey, TValue>, TKey, TValue>(Func<KeyValuePair<TKey, TValue>, TKey>, Func<KeyValuePair<TKey, TValue>, TValue>, IComparer<TKey>, IEqualityComparer<TValue>)Overloaded. Enumerates and transforms a sequence, and produces an immutable sorted dictionary of its contents by using the specified key and value comparers. (Defined by ImmutableSortedDictionary.)
Public Extension MethodToImmutableSortedSet<KeyValuePair<TKey, TValue>>()Overloaded. Enumerates a sequence and produces an immutable sorted set of its contents. (Defined by ImmutableSortedSet.)
Public Extension MethodToImmutableSortedSet<KeyValuePair<TKey, TValue>>(IComparer<KeyValuePair<TKey, TValue>>)Overloaded. Enumerates a sequence, produces an immutable sorted set of its contents, and uses the specified comparer. (Defined by ImmutableSortedSet.)
Top

  NameDescription
Public fieldStatic memberEmptyGets an empty immutable sorted dictionary.
Top

  NameDescription
Explicit interface implemetationPrivate methodICollection<KeyValuePair<TKey, TValue>>.AddAdds the specified item to the collection.
Explicit interface implemetationPrivate methodIDictionary<TKey, TValue>.AddAdds an element with the provided key and value to the immutable dictionary.
Explicit interface implemetationPrivate methodIDictionary.AddAdds an element with the provided key and value to the dictionary object.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<TKey, TValue>>.ClearRemoves all the items from the collection.
Explicit interface implemetationPrivate methodIDictionary.ClearClears this instance.
Explicit interface implemetationPrivate methodIDictionary.ContainsDetermines whether the immutable dictionary object contains an element with the specified key.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<TKey, TValue>>.CopyToCopies the elements of the collection to an array, starting at the specified index.
Explicit interface implemetationPrivate methodICollection.CopyToCopies the elements of the dictionary to an array, starting at a particular array index.
Explicit interface implemetationPrivate methodIEnumerable<KeyValuePair<TKey, TValue>>.GetEnumeratorReturns an enumerator that iterates through the collection.
Explicit interface implemetationPrivate methodIDictionary.GetEnumeratorReturns an IDictionaryEnumerator object for the immutable dictionary object.
Explicit interface implemetationPrivate methodIEnumerable.GetEnumeratorReturns an enumerator that iterates through a collection.
Explicit interface implemetationPrivate propertyIDictionary.IsFixedSizeGets a value indicating whether the immutable dictionary object has a fixed size.
Explicit interface implemetationPrivate propertyICollection<KeyValuePair<TKey, TValue>>.IsReadOnlyGets a value indicating whether the immutable dictionary is read-only.
Explicit interface implemetationPrivate propertyIDictionary.IsReadOnlyGets a value indicating whether the immutable dictionary is read-only.
Explicit interface implemetationPrivate propertyICollection.IsSynchronizedGets a value indicating whether access to the immutable dictionary is synchronized (thread safe).
Explicit interface implemetationPrivate propertyIDictionary<TKey, TValue>.ItemGets or sets the element with the specified key.
Explicit interface implemetationPrivate propertyIDictionary.ItemGets or sets the element with the specified key.
Explicit interface implemetationPrivate propertyIDictionary<TKey, TValue>.KeysGets a collection containing the keys of the immutable dictionary.
Explicit interface implemetationPrivate propertyIDictionary.KeysGets an ICollection<T> object containing the keys of the immutable dictionary.
Explicit interface implemetationPrivate methodICollection<KeyValuePair<TKey, TValue>>.RemoveRemoves the first occurrence of the specified object from the immutable dictionary.
Explicit interface implemetationPrivate methodIDictionary<TKey, TValue>.RemoveRemoves the element with the specified key from the immutable dictionary.
Explicit interface implemetationPrivate methodIDictionary.RemoveRemoves the element with the specified key from the immutable dictionary object.
Explicit interface implemetationPrivate propertyICollection.SyncRootGets an object that can be used to synchronize access to the immutable dictionary.
Explicit interface implemetationPrivate propertyIDictionary<TKey, TValue>.ValuesGets a collection containing the values of the immutable dictionary.
Explicit interface implemetationPrivate propertyIDictionary.ValuesGets an ICollection<T> object containing the values in the immutable dictionary.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.AddAdds an element with the specified key and value to the immutable dictionary.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.AddRangeAdds the specified key/value pairs to the immutable dictionary.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.ClearRetrieves an empty dictionary that has the same ordering and key/value comparison rules as this dictionary instance.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.RemoveRemoves the element with the specified key from the immutable dictionary.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.RemoveRangeRemoves the elements with the specified keys from the immutable dictionary.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.SetItemSets the specified key and value in the immutable dictionary, possibly overwriting an existing value for the key.
Explicit interface implemetationPrivate methodIImmutableDictionary<TKey, TValue>.SetItemsSets the specified key/value pairs in the immutable dictionary, possibly overwriting existing values for the keys.
Top

This type is thread safe.

Show:
© 2014 Microsoft