Search Results for

    Show / Hide Table of Contents

    Class ValueReadOnlyDictionary<TKey, TValue>

    A readonly immutable generic dictionary of non-null keys and values which performs equality by value.

    Inheritance
    System.Object
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>
    ValueReadOnlyDictionary<TKey, TValue>
    Implements
    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<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.IDictionary
    System.Collections.ICollection
    System.Collections.IEnumerable
    Inherited Members
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.get_Item(TKey)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.set_Item(TKey, TValue)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.get_Item(System.Object)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.set_Item(System.Object, System.Object)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.ContainsKey(TKey)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.GetEnumerator()
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Add(System.Collections.Generic.KeyValuePair<TKey, TValue>)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Clear()
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Contains(System.Collections.Generic.KeyValuePair<TKey, TValue>)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.CopyTo(System.Collections.Generic.KeyValuePair<TKey, TValue>[], System.Int32)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.Remove(System.Collections.Generic.KeyValuePair<TKey, TValue>)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Add(TKey, TValue)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Remove(TKey)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.ICollection.CopyTo(System.Array, System.Int32)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Add(System.Object, System.Object)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Clear()
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Contains(System.Object)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.GetEnumerator()
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Remove(System.Object)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IEnumerable.GetEnumerator()
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.TryGetValue(TKey, TValue)
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.Count
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.Dictionary
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.Item[TKey]
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.Keys
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<TKey, TValue>>.IsReadOnly
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Item[TKey]
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Keys
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IDictionary<TKey, TValue>.Values
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Keys
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>.Values
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.ICollection.IsSynchronized
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.ICollection.SyncRoot
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.IsFixedSize
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.IsReadOnly
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Item[System.Object]
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Keys
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.System.Collections.IDictionary.Values
    System.Collections.ObjectModel.ReadOnlyDictionary<TKey, TValue>.Values
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    Namespace: MoreStructures.Utilities
    Assembly: MoreStructures.dll
    Syntax
    public class ValueReadOnlyDictionary<TKey, TValue> : ReadOnlyDictionary<TKey, TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IDictionary, ICollection, IEnumerable
    Type Parameters
    Name Description
    TKey

    The type of keys in the dictionary.

    TValue

    The type of values in the dictionary.

    Remarks

    Immutability can be guaranteed by cloning the provided dictionary and exposing a readonly view of it, but only if immutability of underlying TKey and TValue is provided, for example, by using immutable records.

    Constructors

    | Improve this Doc View Source

    ValueReadOnlyDictionary(IDictionary<TKey, TValue>)

    Creates value readonly dictionary out of the provided dictionary, and independent from it.

    Declaration
    public ValueReadOnlyDictionary(IDictionary<TKey, TValue> dictionary)
    Parameters
    Type Name Description
    IDictionary<TKey, TValue> dictionary

    The dictionary to be used to build the readonly dictionary.

    | Improve this Doc View Source

    ValueReadOnlyDictionary(IEnumerable<KeyValuePair<TKey, TValue>>)

    Creates value readonly dictionary out of the provided entries, and independent from the provided enumerable of them.

    Declaration
    public ValueReadOnlyDictionary(IEnumerable<KeyValuePair<TKey, TValue>> entries)
    Parameters
    Type Name Description
    IEnumerable<KeyValuePair<TKey, TValue>> entries

    The enumerable of entries to be used to build the readonly dictionary.

    Methods

    | Improve this Doc View Source

    Equals(Object)


    Equality is calculated by value, i.e. on the dictionary key-value pairs directly.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    System.Object obj
    Returns
    Type Description
    System.Boolean
    Overrides
    System.Object.Equals(System.Object)
    Remarks

    Two dictionaries are considered equal by value if:

    • they have the same set of keys
    • and the value associated, with each of the key by the two dictionaries are equal with each other.
    | Improve this Doc View Source

    GetHashCode()


    The hash code is calculated by value, as an aggregate of the hash codes of its key value pairs.

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    System.Int32
    Overrides
    System.Object.GetHashCode()
    | Improve this Doc View Source

    ToString()


    Format: "{[k1] = v1, [k2] = v2, ...}".

    Declaration
    public override string ToString()
    Returns
    Type Description
    System.String
    Overrides
    System.Object.ToString()

    Operators

    | Improve this Doc View Source

    Equality(ValueReadOnlyDictionary<TKey, TValue>, ValueReadOnlyDictionary<TKey, TValue>)

    Compare the two provided value read-only dictionaries for equality by value.

    Declaration
    public static bool operator ==(ValueReadOnlyDictionary<TKey, TValue> left, ValueReadOnlyDictionary<TKey, TValue> right)
    Parameters
    Type Name Description
    ValueReadOnlyDictionary<TKey, TValue> left

    The first term of comparison.

    ValueReadOnlyDictionary<TKey, TValue> right

    The second term of comparison.

    Returns
    Type Description
    System.Boolean

    True if the two dictionaries are equal by their items, false otherwise.

    | Improve this Doc View Source

    Inequality(ValueReadOnlyDictionary<TKey, TValue>, ValueReadOnlyDictionary<TKey, TValue>)

    Compare the two provided value read-only dictionaries for inequality by value.

    Declaration
    public static bool operator !=(ValueReadOnlyDictionary<TKey, TValue> left, ValueReadOnlyDictionary<TKey, TValue> right)
    Parameters
    Type Name Description
    ValueReadOnlyDictionary<TKey, TValue> left

    The first term of comparison.

    ValueReadOnlyDictionary<TKey, TValue> right

    The second term of comparison.

    Returns
    Type Description
    System.Boolean

    True if the two dictionaries are different by their items, false otherwise.

    Implements

    System.Collections.Generic.IDictionary<TKey, TValue>
    System.Collections.Generic.ICollection<T>
    System.Collections.Generic.IReadOnlyDictionary<TKey, TValue>
    System.Collections.Generic.IReadOnlyCollection<T>
    System.Collections.Generic.IEnumerable<T>
    System.Collections.IDictionary
    System.Collections.ICollection
    System.Collections.IEnumerable

    Extension Methods

    SuffixStructureNodeExtensions.GetAllSuffixesFor<TEdge, TNode>(TNode, TextWithTerminator)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Generated by DocFX