Show / Hide Table of Contents

    Class ImmutableOrderedDictionary<TKey, TValue>.Builder

    A mutable wrapper around an immutable ordered dictionary.

    Inheritance
    System.Object
    ImmutableOrderedDictionary<TKey, TValue>.Builder
    Implements
    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.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Flame.Collections
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class Builder : IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable

    Properties

    | Improve this Doc View Source

    Count

    Gets the number of key-value pairs in this dictionary.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    System.Int32
    | Improve this Doc View Source

    Item[TKey]

    Gets or sets the value associated with a particular key.

    Declaration
    public TValue this[TKey key] { get; set; }
    Parameters
    Type Name Description
    TKey key

    The key to access.

    Property Value
    Type Description
    TValue

    The value associated with key.

    | Improve this Doc View Source

    KeyComparer

    Gets the value comparer for this dictionary.

    Declaration
    public IEqualityComparer<TKey> KeyComparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEqualityComparer<TKey>
    | 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

    ValueComparer

    Gets the value comparer for this dictionary.

    Declaration
    public IEqualityComparer<TValue> ValueComparer { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEqualityComparer<TValue>
    | 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 dictionary.

    Declaration
    public void Add(TKey key, TValue value)
    Parameters
    Type Name Description
    TKey key

    The key to add.

    TValue value

    The value to associate with key.

    | Improve this Doc View Source

    Add(KeyValuePair<TKey, TValue>)

    Adds a key-value pair to this dictionary.

    Declaration
    public void Add(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item

    The key-value pair to add.

    | Improve this Doc View Source

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

    Adds a sequence of key-value pairs to this dictionary.

    Declaration
    public void AddRange(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.

    | Improve this Doc View Source

    Clear()

    Removes all key-value pairs from this dictionary.

    Declaration
    public void Clear()
    | Improve this Doc View Source

    Contains(KeyValuePair<TKey, TValue>)

    Tests if this dictionary contains a key-value pair.

    Declaration
    public bool Contains(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item

    The key-value pair to look for.

    Returns
    Type Description
    System.Boolean

    true if this dictionary contains item.

    | 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 key.

    | Improve this Doc View Source

    ContainsValue(TValue)

    Tests if this dictionary contains a particular value.

    Declaration
    public bool ContainsValue(TValue value)
    Parameters
    Type Name Description
    TValue value

    The value to look for.

    Returns
    Type Description
    System.Boolean

    true if this dictionary contains value.

    | 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

    GetValueOrDefault(TKey)

    Gets the value associated with a particular key or a default value if this dictionary does not contain the key.

    Declaration
    public TValue GetValueOrDefault(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key to look for.

    Returns
    Type Description
    TValue

    The value associated with key if it exists; otherwise, a default value.

    | Improve this Doc View Source

    GetValueOrDefault(TKey, TValue)

    Gets the value associated with a particular key or a default value if this dictionary does not contain the key.

    Declaration
    public TValue GetValueOrDefault(TKey key, TValue defaultValue)
    Parameters
    Type Name Description
    TKey key

    The key to look for.

    TValue defaultValue

    The value to return if this dictionary does not contain key.

    Returns
    Type Description
    TValue

    The value associated with key if it exists; otherwise, defaultValue.

    | Improve this Doc View Source

    Remove(TKey)

    Removes a key from this dictionary.

    Declaration
    public bool Remove(TKey key)
    Parameters
    Type Name Description
    TKey key

    The key to remove.

    Returns
    Type Description
    System.Boolean

    true if the key was removed; false if this dictionary didn't contain the key in the first place.

    | Improve this Doc View Source

    Remove(KeyValuePair<TKey, TValue>)

    Removes a key-value pair from this dictionary.

    Declaration
    public bool Remove(KeyValuePair<TKey, TValue> item)
    Parameters
    Type Name Description
    System.Collections.Generic.KeyValuePair<TKey, TValue> item

    The key-value pair to remove.

    Returns
    Type Description
    System.Boolean

    true if the key-value pair was removed; false if this dictionary didn't contain the key-value pair in the first place.

    | Improve this Doc View Source

    RemoveRange(IEnumerable<TKey>)

    Removes a range of keys from this ordered dictionary.

    Declaration
    public void RemoveRange(IEnumerable<TKey> keys)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<TKey> keys

    The keys to remove.

    | Improve this Doc View Source

    ToImmutable()

    Creates an immutable ordered dictionary from this mutable builder.

    Declaration
    public ImmutableOrderedDictionary<TKey, TValue> ToImmutable()
    Returns
    Type Description
    ImmutableOrderedDictionary<TKey, TValue>

    An immutable ordered dictionary.

    | Improve this Doc View Source

    TryGetKey(TKey, out TKey)

    Tries to find a key in this dictionary.

    Declaration
    public bool TryGetKey(TKey equalKey, out TKey actualKey)
    Parameters
    Type Name Description
    TKey equalKey

    A key that is equal to the key to look for.

    TKey actualKey

    The key that is stored in the dictionary.

    Returns
    Type Description
    System.Boolean

    true if this dictionary contains a key equal to equalKey; otherwise, false.

    | 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

    Implements

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

    Extension Methods

    BetternessExtensions.TryGetBestElement<T>(IEnumerable<T>, Func<T, T, Betterness>, out T)
    BetternessExtensions.GetBestElementOrDefault<T>(IEnumerable<T>, Func<T, T, Betterness>)
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX