次の方法で共有


ImmutableInterlocked.AddOrUpdate メソッド

定義

オーバーロード

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)

値の追加または既存のエントリの更新後に、その値をディクショナリから取得します。

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, TValue, Func<TKey,TValue,TValue>)

値の追加または既存のエントリの更新後に、その値をディクショナリから取得します。

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, Func<TKey,TValue>, Func<TKey,TValue,TValue>)

ソース:
ImmutableInterlocked.cs
ソース:
ImmutableInterlocked.cs
ソース:
ImmutableInterlocked.cs

値の追加または既存のエントリの更新後に、その値をディクショナリから取得します。

public:
generic <typename TKey, typename TValue>
 static TValue AddOrUpdate(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % ___location, TKey key, Func<TKey, TValue> ^ addValueFactory, Func<TKey, TValue, TValue> ^ updateValueFactory);
public static TValue AddOrUpdate<TKey,TValue> (ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> ___location, TKey key, Func<TKey,TValue> addValueFactory, Func<TKey,TValue,TValue> updateValueFactory);
static member AddOrUpdate : ImmutableDictionary * 'Key * Func<'Key, 'Value> * Func<'Key, 'Value, 'Value> -> 'Value
Public Shared Function AddOrUpdate(Of TKey, TValue) (ByRef ___location As ImmutableDictionary(Of TKey, TValue), key As TKey, addValueFactory As Func(Of TKey, TValue), updateValueFactory As Func(Of TKey, TValue, TValue)) As TValue

型パラメーター

TKey

ディクショナリによって格納されるキーの型。

TValue

ディクショナリによって格納される値の型。

パラメーター

___location
ImmutableDictionary<TKey,TValue>

指定した がディクショナリにない場合にアトミックに更新する変数またはフィールド。

key
TKey

追加または更新する値のキー。

addValueFactory
Func<TKey,TValue>

キーを受け取り、値がまだ存在しない場合にディクショナリに追加する新しい値を返す関数。

updateValueFactory
Func<TKey,TValue,TValue>

キーと以前の値を受け取り、ディクショナリの更新に使用する新しい値を返す関数。

戻り値

TValue

追加または更新された値。

適用対象

AddOrUpdate<TKey,TValue>(ImmutableDictionary<TKey,TValue>, TKey, TValue, Func<TKey,TValue,TValue>)

ソース:
ImmutableInterlocked.cs
ソース:
ImmutableInterlocked.cs
ソース:
ImmutableInterlocked.cs

値の追加または既存のエントリの更新後に、その値をディクショナリから取得します。

public:
generic <typename TKey, typename TValue>
 static TValue AddOrUpdate(System::Collections::Immutable::ImmutableDictionary<TKey, TValue> ^ % ___location, TKey key, TValue addValue, Func<TKey, TValue, TValue> ^ updateValueFactory);
public static TValue AddOrUpdate<TKey,TValue> (ref System.Collections.Immutable.ImmutableDictionary<TKey,TValue> ___location, TKey key, TValue addValue, Func<TKey,TValue,TValue> updateValueFactory);
static member AddOrUpdate : ImmutableDictionary * 'Key * 'Value * Func<'Key, 'Value, 'Value> -> 'Value
Public Shared Function AddOrUpdate(Of TKey, TValue) (ByRef ___location As ImmutableDictionary(Of TKey, TValue), key As TKey, addValue As TValue, updateValueFactory As Func(Of TKey, TValue, TValue)) As TValue

型パラメーター

TKey

ディクショナリによって格納されるキーの型。

TValue

ディクショナリによって格納される値の型。

パラメーター

___location
ImmutableDictionary<TKey,TValue>

指定した がディクショナリにない場合にアトミックに更新する変数またはフィールド。

key
TKey

追加または更新する値のキー。

addValue
TValue

前の値が存在しない場合に使用する値。

updateValueFactory
Func<TKey,TValue,TValue>

キーと以前の値を受け取り、ディクショナリの更新に使用する新しい値を返す関数。

戻り値

TValue

追加または更新された値。

適用対象