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
    System.Object
    SmallMultiDictionary<TKey, TValue>
    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.dll
    Syntax
    public sealed class SmallMultiDictionary<TKey, TValue>
    Type Parameters
    Name Description
    TKey
    TValue

    Constructors

    | Improve this Doc View Source

    SmallMultiDictionary()

    Creates a small multi-dictionary.

    Declaration
    public SmallMultiDictionary()
    | Improve this Doc 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.

    | Improve this Doc View Source

    SmallMultiDictionary(Int32)

    Creates a small multi-dictionary from an initial capacity.

    Declaration
    public SmallMultiDictionary(int initialCapacity)
    Parameters
    Type Name Description
    System.Int32 initialCapacity

    The dictionary's initial capacity.

    Properties

    | Improve this Doc View Source

    Count

    Gets the number of elements in the multi-dictionary.

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

    The number of elements in the multi-dictionary.

    | Improve this Doc View Source

    Values

    Gets 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)

    Inserts an item into this dictionary.

    Declaration
    public void Add(TKey Key, TValue Value)
    Parameters
    Type Name Description
    TKey Key
    TValue Value
    | Improve this Doc 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
    | Improve this Doc 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
    System.Boolean
    | Improve this Doc 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
    System.Collections.Generic.IEnumerable<TValue>
    | Improve this Doc 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
    | Improve this Doc 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
    System.Boolean
    | Improve this Doc View Source

    Reserve(Int32)

    Reserves the given capacity in this small multi dictionary.

    Declaration
    public void Reserve(int MinimalCapacity)
    Parameters
    Type Name Description
    System.Int32 MinimalCapacity
    | Improve this Doc 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
    System.Boolean
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX