Class CharSpanLookupDictionary<TValue>
- Namespace
- DisCatSharp.Common
- Assembly
- DisCatSharp.Common.dll
Represents collection of string keys and TValue
values, allowing the use of
ReadOnlySpan<T> for dictionary operations.
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
TValue
Type of items in this dictionary.
- Inheritance
-
CharSpanLookupDictionary<TValue>
- Implements
-
IDictionary<string, TValue>IReadOnlyDictionary<string, TValue>
- Inherited Members
- Extension Methods
Constructors
- CharSpanLookupDictionary()
Creates a new, empty CharSpanLookupDictionary<TValue> with string keys and items of type
TValue
.
- 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.
- 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.
- 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.
- CharSpanLookupDictionary(int)
Creates a new, empty CharSpanLookupDictionary<TValue> with string keys and items of type
TValue
and sets its initial capacity to specified value.
Properties
- Count
Gets the total number of items in this dictionary.
- IsFixedSize
Gets whether this dictionary has a fixed size.
- IsReadOnly
Gets whether this dictionary is read-only.
- IsSynchronized
Gets whether this dictionary is considered thread-safe.
- this[ReadOnlySpan<char>]
Gets or sets a value corresponding to given key in this dictionary.
- this[string]
Gets or sets a value corresponding to given key in this dictionary.
- Keys
Gets the collection of all keys present in this dictionary.
- SyncRoot
Gets the object which allows synchronizing access to this dictionary.
- Values
Gets the collection of all values present in this dictionary.
Methods
- Add(ReadOnlySpan<char>, TValue?)
Inserts a specific key and corresponding value into this dictionary.
- Add(string, TValue?)
Inserts a specific key and corresponding value into this dictionary.
- Clear()
Removes all items from this dictionary.
- ContainsKey(ReadOnlySpan<char>)
Checks whether this dictionary contains the specified key.
- ContainsKey(string)
Checks whether this dictionary contains the specified key.
- GetEnumerator()
Gets an enumerator over key-value pairs in this dictionary.
- TryAdd(ReadOnlySpan<char>, TValue?)
Attempts to insert a specific key and corresponding value into this dictionary.
- TryAdd(string, TValue?)
Attempts to insert a specific key and corresponding value into this dictionary.
- TryGetValue(ReadOnlySpan<char>, out TValue?)
Attempts to retrieve a value corresponding to the supplied key from this dictionary.
- TryGetValue(string, out TValue?)
Attempts to retrieve a value corresponding to the supplied key from this dictionary.
- TryRemove(ReadOnlySpan<char>, out TValue?)
Attempts to remove a value corresponding to the supplied key from this dictionary.
- TryRemove(string, out TValue?)
Attempts to remove a value corresponding to the supplied key from this dictionary.
Explicit Interface Implementations
- ICollection<KeyValuePair<string, TValue?>>.CopyTo(KeyValuePair<string, TValue?>[], int)
Copies the to.
- IDictionary<string, TValue?>.Keys
Gets the keys.
- IDictionary<string, TValue?>.Remove(string)
Removes the.
- IDictionary<string, TValue?>.Values
Gets the values.
- ICollection.CopyTo(Array, int)
Copies the to.
- IDictionary.Add(object, object?)
Adds the.
- IDictionary.Contains(object)
Contains the.
- IDictionary.GetEnumerator()
Gets the enumerator.
- IDictionary.this[object]
Gets or sets the element with the specified key.
- IDictionary.Keys
Gets the keys.
- IDictionary.Remove(object)
Removes the.
- IDictionary.Values
Gets the values.
- IEnumerable.GetEnumerator()
Gets the enumerator.