Search Results for

    Show / Hide Table of Contents

    Class CharSpanLookupDictionary<TValue>

    Represents collection of string keys and TValue values, allowing the use of System.ReadOnlySpan<T> for dictionary operations.

    Inheritance
    System.Object
    CharSpanLookupDictionary<TValue>
    Namespace: DisCatSharp.Common
    Assembly: DisCatSharp.Common.dll
    Syntax
    public sealed class CharSpanLookupDictionary<TValue> : IDictionary<string, TValue>, ICollection<KeyValuePair<string, TValue>>, IReadOnlyDictionary<string, TValue>, IReadOnlyCollection<KeyValuePair<string, TValue>>, IEnumerable<KeyValuePair<string, TValue>>, IDictionary, ICollection, IEnumerable
    Type Parameters
    Name Description
    TValue

    Type of items in this dictionary.

    Constructors

    | Improve this Doc View Source

    CharSpanLookupDictionary()

    Creates a new, empty CharSpanLookupDictionary<TValue> with string keys and items of type TValue.

    Declaration
    public CharSpanLookupDictionary()
    | Improve this Doc View Source

    CharSpanLookupDictionary(IDictionary<String, TValue>)

    Creates a new CharSpanLookupDictionary<TValue> with string keys and items of type TValue and populates it with key-value pairs from supplied dictionary.

    Declaration
    public CharSpanLookupDictionary(IDictionary<string, TValue> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IDictionary<System.String, TValue> values

    Dictionary containing items to populate this dictionary with.

    | Improve this Doc View Source

    CharSpanLookupDictionary(IEnumerable<KeyValuePair<String, TValue>>)

    Creates a new CharSpanLookupDictionary<TValue> with string keys and items of type TValue and populates it with key-value pairs from supplied key-value collection.

    Declaration
    public CharSpanLookupDictionary(IEnumerable<KeyValuePair<string, TValue>> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<System.String, TValue>> values

    Dictionary containing items to populate this dictionary with.

    | Improve this Doc View Source

    CharSpanLookupDictionary(IReadOnlyDictionary<String, TValue>)

    Creates a new CharSpanLookupDictionary<TValue> with string keys and items of type TValue and populates it with key-value pairs from supplied dictionary.

    Declaration
    public CharSpanLookupDictionary(IReadOnlyDictionary<string, TValue> values)
    Parameters
    Type Name Description
    System.Collections.Generic.IReadOnlyDictionary<System.String, TValue> values

    Dictionary containing items to populate this dictionary with.

    | Improve this Doc View Source

    CharSpanLookupDictionary(Int32)

    Creates a new, empty CharSpanLookupDictionary<TValue> with string keys and items of type TValue and sets its initial capacity to specified value.

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

    Initial capacity of the dictionary.

    Properties

    | Improve this Doc View Source

    Count

    Gets the total number of items in this dictionary.

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

    IsFixedSize

    Gets whether this dictionary has a fixed size.

    Declaration
    public bool IsFixedSize { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsReadOnly

    Gets whether this dictionary is read-only.

    Declaration
    public bool IsReadOnly { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    IsSynchronized

    Gets whether this dictionary is considered thread-safe.

    Declaration
    public bool IsSynchronized { get; }
    Property Value
    Type Description
    System.Boolean
    | Improve this Doc View Source

    Item[ReadOnlySpan<Char>]

    Gets or sets a value corresponding to given key in this dictionary.

    Declaration
    public TValue this[ReadOnlySpan<char> key] { get; set; }
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to get or set the value for.

    Property Value
    Type Description
    TValue

    Value matching the supplied key, if applicable.

    | Improve this Doc View Source

    Item[String]

    Gets or sets a value corresponding to given key in this dictionary.

    Declaration
    public TValue this[string key] { get; set; }
    Parameters
    Type Name Description
    System.String key

    Key to get or set the value for.

    Property Value
    Type Description
    TValue

    Value matching the supplied key, if applicable.

    | Improve this Doc View Source

    Keys

    Gets the collection of all keys present in this dictionary.

    Declaration
    public IEnumerable<string> Keys { get; }
    Property Value
    Type Description
    System.Collections.Generic.IEnumerable<System.String>
    | Improve this Doc View Source

    SyncRoot

    Gets the object which allows synchronizing access to this dictionary.

    Declaration
    public object SyncRoot { get; }
    Property Value
    Type Description
    System.Object
    | Improve this Doc View Source

    Values

    Gets the collection of all values present 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(ReadOnlySpan<Char>, TValue)

    Inserts a specific key and corresponding value into this dictionary.

    Declaration
    public void Add(ReadOnlySpan<char> key, TValue value)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to insert.

    TValue value

    Value corresponding to this key.

    | Improve this Doc View Source

    Add(String, TValue)

    Inserts a specific key and corresponding value into this dictionary.

    Declaration
    public void Add(string key, TValue value)
    Parameters
    Type Name Description
    System.String key

    Key to insert.

    TValue value

    Value corresponding to this key.

    | Improve this Doc View Source

    Clear()

    Removes all items from this dictionary.

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

    ContainsKey(ReadOnlySpan<Char>)

    Checks whether this dictionary contains the specified key.

    Declaration
    public bool ContainsKey(ReadOnlySpan<char> key)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to check for in this dictionary.

    Returns
    Type Description
    System.Boolean

    Whether the key was present in the dictionary.

    | Improve this Doc View Source

    ContainsKey(String)

    Checks whether this dictionary contains the specified key.

    Declaration
    public bool ContainsKey(string key)
    Parameters
    Type Name Description
    System.String key

    Key to check for in this dictionary.

    Returns
    Type Description
    System.Boolean

    Whether the key was present in the dictionary.

    | Improve this Doc View Source

    GetEnumerator()

    Gets an enumerator over key-value pairs in this dictionary.

    Declaration
    public IEnumerator<KeyValuePair<string, TValue>> GetEnumerator()
    Returns
    Type Description
    System.Collections.Generic.IEnumerator<System.Collections.Generic.KeyValuePair<System.String, TValue>>
    | Improve this Doc View Source

    TryAdd(ReadOnlySpan<Char>, TValue)

    Attempts to insert a specific key and corresponding value into this dictionary.

    Declaration
    public bool TryAdd(ReadOnlySpan<char> key, TValue value)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to insert.

    TValue value

    Value corresponding to this key.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    | Improve this Doc View Source

    TryAdd(String, TValue)

    Attempts to insert a specific key and corresponding value into this dictionary.

    Declaration
    public bool TryAdd(string key, TValue value)
    Parameters
    Type Name Description
    System.String key

    Key to insert.

    TValue value

    Value corresponding to this key.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    | Improve this Doc View Source

    TryGetValue(ReadOnlySpan<Char>, out TValue)

    Attempts to retrieve a value corresponding to the supplied key from this dictionary.

    Declaration
    public bool TryGetValue(ReadOnlySpan<char> key, out TValue value)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to retrieve the value for.

    TValue value

    Retrieved value.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    | Improve this Doc View Source

    TryGetValue(String, out TValue)

    Attempts to retrieve a value corresponding to the supplied key from this dictionary.

    Declaration
    public bool TryGetValue(string key, out TValue value)
    Parameters
    Type Name Description
    System.String key

    Key to retrieve the value for.

    TValue value

    Retrieved value.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    | Improve this Doc View Source

    TryRemove(ReadOnlySpan<Char>, out TValue)

    Attempts to remove a value corresponding to the supplied key from this dictionary.

    Declaration
    public bool TryRemove(ReadOnlySpan<char> key, out TValue value)
    Parameters
    Type Name Description
    System.ReadOnlySpan<System.Char> key

    Key to remove the value for.

    TValue value

    Removed value.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    | Improve this Doc View Source

    TryRemove(String, out TValue)

    Attempts to remove a value corresponding to the supplied key from this dictionary.

    Declaration
    public bool TryRemove(string key, out TValue value)
    Parameters
    Type Name Description
    System.String key

    Key to remove the value for.

    TValue value

    Removed value.

    Returns
    Type Description
    System.Boolean

    Whether the operation was successful.

    Extension Methods

    ReflectionUtilities.ToDictionary<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top © 2021-2022 Aiko IT Systems