Language

CollectionsMarshal.GetValueRefOrAddDefault メソッド

定義

オーバーロード

名前 説明
GetValueRefOrAddDefault<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey, Boolean)

Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>内のTValueへの参照を取得し、dictionaryに存在しない場合は既定値の新しいエントリを追加します。

GetValueRefOrAddDefault<TKey,TValue>(Dictionary<TKey,TValue>, TKey, Boolean)

指定したディクショナリ内の TValue への参照を取得し、キーが存在しない場合は既定値の新しいエントリを追加します。

GetValueRefOrAddDefault<TKey,TValue,TAlternateKey>(Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>, TAlternateKey, Boolean)

ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs

Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>内のTValueへの参照を取得し、dictionaryに存在しない場合は既定値の新しいエントリを追加します。

public:
generic <typename TKey, typename TValue, typename TAlternateKey>
 static TValue % GetValueRefOrAddDefault(System::Collections::Generic::Dictionary<TKey, TValue>::AlternateLookup<TAlternateKey> dictionary, TAlternateKey key, [Runtime::InteropServices::Out] bool % exists);
public static ref TValue? GetValueRefOrAddDefault<TKey,TValue,TAlternateKey>(System.Collections.Generic.Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey> dictionary, TAlternateKey key, out bool exists) where TAlternateKey : allows ref struct;
static member GetValueRefOrAddDefault : System.Collections.Generic.Dictionary<'Key, 'Value>.AlternateLookup<'AlternateKey> * 'AlternateKey * bool -> 'Value
Public Shared Function GetValueRefOrAddDefault(Of TKey, TValue, TAlternateKey) (dictionary As Dictionary(Of TKey, TValue).AlternateLookup(Of TAlternateKey), key As TAlternateKey, ByRef exists As Boolean) As TValue

型パラメーター

TKey

ディクショナリ内のキーの型。

TValue

ディクショナリ内の値の型。

TAlternateKey

ディクショナリ検索の代替キーの型。

パラメーター

dictionary
Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>

TValueの参照を取得するディクショナリ。

key
TAlternateKey

検索に使用されるキー。

exists
Boolean

指定されたキーの新しいエントリがディクショナリに追加されたかどうか。

返品

TValue

指定したDictionary<TKey,TValue>.AlternateLookup<TAlternateKey>内のTValueへの参照。

注釈

ref TValueが使用されている間は、Dictionary<TKey,TValue>.AlternateLookup<TAlternateKey>に項目を追加したり、から削除したりしないでください。

適用対象

GetValueRefOrAddDefault<TKey,TValue>(Dictionary<TKey,TValue>, TKey, Boolean)

ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs
ソース:
CollectionsMarshal.cs

指定したディクショナリ内の TValue への参照を取得し、キーが存在しない場合は既定値の新しいエントリを追加します。

public:
generic <typename TKey, typename TValue>
 static TValue % GetValueRefOrAddDefault(System::Collections::Generic::Dictionary<TKey, TValue> ^ dictionary, TKey key, [Runtime::InteropServices::Out] bool % exists);
public static ref TValue? GetValueRefOrAddDefault<TKey,TValue>(System.Collections.Generic.Dictionary<TKey,TValue> dictionary, TKey key, out bool exists);
static member GetValueRefOrAddDefault : System.Collections.Generic.Dictionary<'Key, 'Value> * 'Key * bool -> 'Value
Public Shared Function GetValueRefOrAddDefault(Of TKey, TValue) (dictionary As Dictionary(Of TKey, TValue), key As TKey, ByRef exists As Boolean) As TValue

型パラメーター

TKey

キーの型。

TValue

値の型。

パラメーター

dictionary
Dictionary<TKey,TValue>

TValueへの参照を取得するディクショナリ。

key
TKey

検索に使用されるキー。

exists
Boolean

このメソッドが戻るときに、ディクショナリに既に存在key場合はtrueが格納され、新しいエントリが追加された場合はfalseされます。

返品

TValue

指定したディクショナリ内の TValue への参照。

注釈

ref TValueが使用されている間は、Dictionary<TKey,TValue>に項目を追加したり、から削除したりしないでください。

適用対象