Gorgon
Show / Hide Table of Contents

Class GorgonConcurrentDictionary<TK, TV>

A custom concurrent dictionary that supplements the original ConcurrentDictionary<TKey, TValue> type by supplying a read-only interface.

Inheritance
object
ConcurrentDictionary<TK, TV>
GorgonConcurrentDictionary<TK, TV>
Implements
IDictionary<TK, TV>
ICollection<KeyValuePair<TK, TV>>
IDictionary
ICollection
IReadOnlyDictionary<TK, TV>
IReadOnlyCollection<KeyValuePair<TK, TV>>
IEnumerable<KeyValuePair<TK, TV>>
IEnumerable
Inherited Members
ConcurrentDictionary<TK, TV>.TryAdd(TK, TV)
ConcurrentDictionary<TK, TV>.ContainsKey(TK)
ConcurrentDictionary<TK, TV>.TryRemove(TK, out TV)
ConcurrentDictionary<TK, TV>.TryGetValue(TK, out TV)
ConcurrentDictionary<TK, TV>.TryUpdate(TK, TV, TV)
ConcurrentDictionary<TK, TV>.Clear()
ConcurrentDictionary<TK, TV>.ToArray()
ConcurrentDictionary<TK, TV>.GetEnumerator()
ConcurrentDictionary<TK, TV>.GetOrAdd(TK, Func<TK, TV>)
ConcurrentDictionary<TK, TV>.GetOrAdd(TK, TV)
ConcurrentDictionary<TK, TV>.GetOrAdd<TArg>(TK, Func<TK, TArg, TV>, TArg)
ConcurrentDictionary<TK, TV>.AddOrUpdate<TArg>(TK, Func<TK, TArg, TV>, Func<TK, TV, TArg, TV>, TArg)
ConcurrentDictionary<TK, TV>.AddOrUpdate(TK, Func<TK, TV>, Func<TK, TV, TV>)
ConcurrentDictionary<TK, TV>.AddOrUpdate(TK, TV, Func<TK, TV, TV>)
ConcurrentDictionary<TK, TV>.this[TK]
ConcurrentDictionary<TK, TV>.Count
ConcurrentDictionary<TK, TV>.IsEmpty
ConcurrentDictionary<TK, TV>.Keys
ConcurrentDictionary<TK, TV>.Values
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.Collections.Specialized
Assembly: Gorgon.Core.dll
Syntax
public class GorgonConcurrentDictionary<TK, TV> : ConcurrentDictionary<TK, TV>, IDictionary<TK, TV>, ICollection<KeyValuePair<TK, TV>>, IDictionary, ICollection, IReadOnlyDictionary<TK, TV>, IReadOnlyCollection<KeyValuePair<TK, TV>>, IEnumerable<KeyValuePair<TK, TV>>, IEnumerable
Type Parameters
Name Description
TK

The key type for the dictionary.

TV

The value type for the dictionary.

Remarks

This type is the same as the ConcurrentDictionary<TKey, TValue> type, with the only difference being that it supports the IReadOnlyDictionary<TKey, TValue> interface. See the documentation on ConcurrentDictionary<TKey, TValue> for more information.

Constructors

| Edit this page View Source

GorgonConcurrentDictionary()

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary()
| Edit this page View Source

GorgonConcurrentDictionary(IEnumerable<KeyValuePair<TK, TV>>)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(IEnumerable<KeyValuePair<TK, TV>> collection)
Parameters
Type Name Description
IEnumerable<KeyValuePair<TK, TV>> collection

The collection used to populate the dictionary.

| Edit this page View Source

GorgonConcurrentDictionary(IEnumerable<KeyValuePair<TK, TV>>, IEqualityComparer<TK>)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(IEnumerable<KeyValuePair<TK, TV>> collection, IEqualityComparer<TK> comparer)
Parameters
Type Name Description
IEnumerable<KeyValuePair<TK, TV>> collection

The collection used to populate the dictionary.

IEqualityComparer<TK> comparer

The IEqualityComparer<T> to use when looking up keys in the dictionary.

| Edit this page View Source

GorgonConcurrentDictionary(IEqualityComparer<TK>)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(IEqualityComparer<TK> comparer)
Parameters
Type Name Description
IEqualityComparer<TK> comparer

The IEqualityComparer<T> to use when looking up keys in the dictionary.

| Edit this page View Source

GorgonConcurrentDictionary(int, IEnumerable<KeyValuePair<TK, TV>>, IEqualityComparer<TK>)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(int concurrencyLevel, IEnumerable<KeyValuePair<TK, TV>> collection, IEqualityComparer<TK> comparer)
Parameters
Type Name Description
int concurrencyLevel

The estimated number of threads that will update the dictionary concurrently.

IEnumerable<KeyValuePair<TK, TV>> collection

The collection used to populate the dictionary.

IEqualityComparer<TK> comparer

The IEqualityComparer<T> to use when looking up keys in the dictionary.

| Edit this page View Source

GorgonConcurrentDictionary(int, int)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(int concurrencyLevel, int capacity)
Parameters
Type Name Description
int concurrencyLevel

The estimated number of threads that will update the dictionary concurrently.

int capacity

The initial number of elements that the dictionary can contain.

| Edit this page View Source

GorgonConcurrentDictionary(int, int, IEqualityComparer<TK>)

Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.

Declaration
public GorgonConcurrentDictionary(int concurrencyLevel, int capacity, IEqualityComparer<TK> comparer)
Parameters
Type Name Description
int concurrencyLevel

The estimated number of threads that will update the dictionary concurrently.

int capacity

The initial number of elements that the dictionary can contain.

IEqualityComparer<TK> comparer

The IEqualityComparer<T> to use when looking up keys in the dictionary.

Properties

| Edit this page View Source

Keys

Gets a collection containing the keys in the Dictionary<TKey, TValue>.

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

Values

Gets a collection containing the values in the Dictionary<TKey, TValue>.

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

Implements

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

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonDebugExtensions.ValidateIndex(ICollection, int)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author