Search Results for

    Show / Hide Table of Contents

    Class SmallMultiDictionary<TKey, TValue>

    A small, memory-friendly and cache-friendly dictionary with O(n) asymptotic complexity for all operations.

    Inheritance
    object
    SmallMultiDictionary<TKey, TValue>
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Flame.Collections
    Assembly: Flame.dll
    Syntax
    public sealed class SmallMultiDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue

    Constructors

    | Edit this page View Source

    SmallMultiDictionary()

    Creates a small multi-dictionary.

    Declaration
    public SmallMultiDictionary()
    | Edit this page View Source

    SmallMultiDictionary(SmallMultiDictionary<TKey, TValue>)

    Creates a small multi-dictionary by copying the contents of another small multi-dictionary.

    Declaration
    public SmallMultiDictionary(SmallMultiDictionary<TKey, TValue> other)
    Parameters
    Type Name Description
    SmallMultiDictionary<TKey, TValue> other

    The other multi-dictionary.

    | Edit this page View Source

    SmallMultiDictionary(int)

    Creates a small multi-dictionary from an initial capacity.

    Declaration
    public SmallMultiDictionary(int initialCapacity)
    Parameters
    Type Name Description
    int initialCapacity

    The dictionary's initial capacity.

    Properties

    | Edit this page View Source

    Count

    Gets the number of elements in the multi-dictionary.

    Declaration
    public int Count { get; }
    Property Value
    Type Description
    int

    The number of elements in the multi-dictionary.

    | Edit this page View Source

    Values

    Gets all values in this dictionary.

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

    Methods

    | Edit this page View Source

    Add(TKey, TValue)

    Inserts an item into this dictionary.

    Declaration
    public void Add(TKey Key, TValue Value)
    Parameters
    Type Name Description
    TKey Key
    TValue Value
    | Edit this page View Source

    AddRange(SmallMultiDictionary<TKey, TValue>)

    Inserts a range of items into this dictionary.

    Declaration
    public void AddRange(SmallMultiDictionary<TKey, TValue> Other)
    Parameters
    Type Name Description
    SmallMultiDictionary<TKey, TValue> Other
    | Edit this page View Source

    ContainsKey(TKey)

    Checks if this dictionary contains at least one element with the given key.

    Declaration
    public bool ContainsKey(TKey Key)
    Parameters
    Type Name Description
    TKey Key
    Returns
    Type Description
    bool
    | Edit this page View Source

    GetAll(TKey)

    Gets all values with the given key.

    Declaration
    public IEnumerable<TValue> GetAll(TKey Key)
    Parameters
    Type Name Description
    TKey Key
    Returns
    Type Description
    IEnumerable<TValue>
    | Edit this page View Source

    PeekOrDefault(TKey)

    Tries to retrieve the first value with the given key in this dictionary. If no such item exists, then the default value is returned.

    Declaration
    public TValue PeekOrDefault(TKey Key)
    Parameters
    Type Name Description
    TKey Key
    Returns
    Type Description
    TValue
    | Edit this page View Source

    Remove(TKey)

    Removes all key-value pairs with the given key from this dictionary.

    Declaration
    public bool Remove(TKey Key)
    Parameters
    Type Name Description
    TKey Key
    Returns
    Type Description
    bool
    | Edit this page View Source

    Reserve(int)

    Reserves the given capacity in this small multi dictionary.

    Declaration
    public void Reserve(int MinimalCapacity)
    Parameters
    Type Name Description
    int MinimalCapacity
    | Edit this page View Source

    TryPeek(TKey, out TValue)

    Tries to retrieve the first value with the given key in this dictionary.

    Declaration
    public bool TryPeek(TKey Key, out TValue Result)
    Parameters
    Type Name Description
    TKey Key
    TValue Result
    Returns
    Type Description
    bool
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX