Skip to content

T_CodeJam_Collections_DictionaryExtensions

Andrew Koryavchenko edited this page Jun 17, 2018 · 10 revisions

DictionaryExtensions Class

Extensions for IDictionary(TKey, TValue)

Inheritance Hierarchy

System.Object
  CodeJam.Collections.DictionaryExtensions
Namespace: CodeJam.Collections
Assembly: CodeJam (in CodeJam.dll) Version: 2.1.0.0

Syntax

C#

public static class DictionaryExtensions

VB

<ExtensionAttribute>
Public NotInheritable Class DictionaryExtensions

F#

[<AbstractClassAttribute>]
[<SealedAttribute>]
[<ExtensionAttribute>]
type DictionaryExtensions =  class end

Methods

 

Name Description
Public methodStatic member AddOrUpdate(TKey, TValue)(ConcurrentDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Adds a key/value pair to the ConcurrentDictionary(TKey, TValue) if the key does not already exist, or updates a key/value pair ConcurrentDictionary(TKey, TValue) by using the specified function if the key already exists.
Public methodStatic member AddOrUpdate(TKey, TValue)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist, or updates a key/value pair IDictionary(TKey, TValue) by using the specified function if the key already exists.
Public methodStatic member AddOrUpdate(TKey, TValue)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue), Func(TKey, TValue, TValue)) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist, or updates a key/value pair IDictionary(TKey, TValue) by using the specified function if the key already exists.
Public methodStatic member AddOrUpdate(TKey, TValue)(IDictionary(TKey, TValue), TKey, TValue, Func(TKey, TValue, TValue)) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist, or updates a key/value pair IDictionary(TKey, TValue) by using the specified function if the key already exists.
Public methodStatic member GetOrAdd(TKey, TValue)(IDictionary(TKey, TValue), TKey) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist.
Public methodStatic member GetOrAdd(TKey, TValue)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist.
Public methodStatic member GetOrAdd(TKey, TValue)(IDictionary(TKey, TValue), TKey, TValue) Adds a key/value pair to the IDictionary(TKey, TValue) if the key does not already exist.
Public methodStatic member GetValueOrDefault(TKey, TValue)(ConcurrentDictionary(TKey, TValue), TKey) Returns value associated with key, or default(TValue) if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(Dictionary(TKey, TValue), TKey) Returns value associated with key, or default(TValue) if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IDictionary(TKey, TValue), TKey) Returns value associated with key, or default(TValue) if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IReadOnlyDictionary(TKey, TValue), TKey) Returns value associated with key, or default(TValue) if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(ConcurrentDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(ConcurrentDictionary(TKey, TValue), TKey, TValue) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(Dictionary(TKey, TValue), TKey, Func(TKey, TValue)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(Dictionary(TKey, TValue), TKey, TValue) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IDictionary(TKey, TValue), TKey, TValue) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IReadOnlyDictionary(TKey, TValue), TKey, Func(TKey, TValue)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue)(IReadOnlyDictionary(TKey, TValue), TKey, TValue) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(ConcurrentDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult)) Returns value associated with key, or default value if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(Dictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult)) Returns value associated with key, or default value if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult)) Returns value associated with key, or default value if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IReadOnlyDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult)) Returns value associated with key, or default value if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(ConcurrentDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), Func(TKey, TResult)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(ConcurrentDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), TResult) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(Dictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), Func(TKey, TResult)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(Dictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), TResult) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), Func(TKey, TResult)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), TResult) Returns value associated with key, or defaultValue if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IReadOnlyDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), Func(TKey, TResult)) Returns value associated with key, or value returned by defaultValueFactory if key does not exists in dictionary
Public methodStatic member GetValueOrDefault(TKey, TValue, TResult)(IReadOnlyDictionary(TKey, TValue), TKey, Func(TKey, TValue, TResult), TResult) Returns value associated with key, or defaultValue if key does not exists in dictionary
  Back to Top

See Also

Reference

CodeJam.Collections Namespace

Clone this wiki locally