Class GorgonConcurrentDictionary<TK, TV>
A custom concurrent dictionary that supplements the original ConcurrentDictionary<TKey, TValue> type by supplying a read-only interface.
Implements
Inherited Members
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 SourceGorgonConcurrentDictionary()
Initializes a new instance of the GorgonConcurrentDictionary<TK, TV> class.
Declaration
public GorgonConcurrentDictionary()
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. |
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. |
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. |
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. |
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. |
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 SourceKeys
Gets a collection containing the keys in the Dictionary<TKey, TValue>.
Declaration
public IEnumerable<TK> Keys { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TK> |
Values
Gets a collection containing the values in the Dictionary<TKey, TValue>.
Declaration
public IEnumerable<TV> Values { get; }
Property Value
Type | Description |
---|---|
IEnumerable<TV> |