Search Results for

    Show / Hide Table of Contents

    Class ImmutableOrderedDictionary<TKey, TValue>.Builder

    A mutable wrapper around an immutable ordered dictionary.

    Inheritance
    object
    ImmutableOrderedDictionary<TKey, TValue>.Builder
    Implements
    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<KeyValuePair<TKey, TValue>>
    IEnumerable<KeyValuePair<TKey, TValue>>
    IEnumerable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Collections
    Assembly: Flame.Compiler.dll
    Syntax
    public sealed class ImmutableOrderedDictionary<TKey, TValue>.Builder : IReadOnlyDictionary<TKey, TValue>, IReadOnlyCollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable

    Properties

    | Edit this page View Source

    Count

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

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int
    | Edit this page View Source

    this[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.

    | Edit this page View Source

    KeyComparer

    Gets the value comparer for this dictionary.

    Declaration
    public IEqualityComparer<TKey> KeyComparer { get; }
    Property Value
    Type Description
    IEqualityComparer<TKey>
    | Edit this page View Source

    Keys

    Gets a sequence of all keys in this dictionary.

    Declaration
    public IEnumerable<TKey> Keys { get; }
    Property Value
    Type Description
    IEnumerable<TKey>
    | Edit this page View Source

    ValueComparer

    Gets the value comparer for this dictionary.

    Declaration
    public IEqualityComparer<TValue> ValueComparer { get; }
    Property Value
    Type Description
    IEqualityComparer<TValue>
    | Edit this page View Source

    Values

    Gets a sequence of all values in this dictionary.

    Declaration
    public IEnumerable<TValue> Values { get; }
    Property Value
    Type Description
    IEnumerable<TValue>

    Methods

    | Edit this page 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
    KeyValuePair<TKey, TValue> item

    The key-value pair to add.

    | Edit this page 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.

    | Edit this page 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
    IEnumerable<KeyValuePair<TKey, TValue>> items

    The key-value pairs to add.

    | Edit this page View Source

    Clear()

    Removes all key-value pairs from this dictionary.

    Declaration
    public void Clear()
    | Edit this page 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
    KeyValuePair<TKey, TValue> item

    The key-value pair to look for.

    Returns
    Type Description
    bool

    true if this dictionary contains item.

    | Edit this page 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
    bool

    true if this dictionary contains key.

    | Edit this page 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
    bool

    true if this dictionary contains value.

    | Edit this page View Source

    GetEnumerator()

    Returns an enumerator that iterates through the collection.

    Declaration
    public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator()
    Returns
    Type Description
    IEnumerator<KeyValuePair<TKey, TValue>>

    An enumerator that can be used to iterate through the collection.

    | Edit this page 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.

    | Edit this page 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.

    | Edit this page 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
    KeyValuePair<TKey, TValue> item

    The key-value pair to remove.

    Returns
    Type Description
    bool

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

    | Edit this page 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
    bool

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

    | Edit this page 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
    IEnumerable<TKey> keys

    The keys to remove.

    | Edit this page 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.

    | Edit this page 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
    bool

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

    | Edit this page View Source

    TryGetValue(TKey, out TValue)

    Gets the value that is associated with the specified key.

    Declaration
    public bool TryGetValue(TKey key, out TValue value)
    Parameters
    Type Name Description
    TKey key

    The key to locate.

    TValue value

    When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized.

    Returns
    Type Description
    bool

    true if the object that implements the IReadOnlyDictionary<TKey, TValue> interface contains an element that has the specified key; otherwise, false.

    Exceptions
    Type Condition
    ArgumentNullException

    key is null.

    Implements

    IReadOnlyDictionary<TKey, TValue>
    IReadOnlyCollection<T>
    IEnumerable<T>
    IEnumerable

    Extension Methods

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