SortedDictionary.Values プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SortedDictionary.Values プロパティの意味・解説 

SortedDictionary.Values プロパティ

メモ : このプロパティは、.NET Framework version 2.0新しく追加されたものです。

SortedDictionary 内の値を格納しているコレクション取得します

名前空間: System.Collections.Generic
アセンブリ: System (system.dll 内)
構文構文

Dim instance As SortedDictionary(Of
 TKey, TValue)
Dim value As ValueCollection

value = instance.Values
public ValueCollection Values { get; }
public:
property ValueCollection^ Values {
    ValueCollection^ get ();
}
/** @property */
public ValueCollection get_Values ()
public function get Values
 () : ValueCollection

プロパティ
SortedDictionary 内のキー格納している SortedDictionary.ValueCollection。

解説解説

SortedDictionary.ValueCollection 内の値は、Comparer プロパティに従って並べ替えられ、関連付けられているキーが、Keys プロパティから返された SortedDictionary.KeyCollection 内で並べ替えられている順序と同じです。

返される SortedDictionary.ValueCollection静的コピーではありません。代わりに、この SortedDictionary.ValueCollection は、元の SortedDictionary の値を参照します。そのため、SortedDictionary対す変更は、SortedDictionary.ValueCollection にも反映されます。

このプロパティ値を取得することは、O(1) 操作なります

使用例使用例

このコード例では、Values プロパティ使用してディクショナリの値を列挙する方法およびディクショナリのキーと値を列挙する方法示します

このコード例は、SortedDictionary クラストピック取り上げているコード例一部分です。

        ' To get the values alone, use the Values property.
        Dim valueColl _
            As SortedDictionary(Of String,
 String).ValueCollection = _
            openWith.Values
        
        ' The elements of the ValueCollection are strongly typed
        ' with the type that was specified for dictionary values.
        Console.WriteLine()
        For Each s As String
 In valueColl 
            Console.WriteLine("Value = {0}", s)
        Next s
<br /><span space="preserve">...</span><br
 />        ' When you use foreach to enumerate dictionary elements
,
        ' the elements are retrieved as KeyValuePair objects.
        Console.WriteLine()
        For Each kvp As
 KeyValuePair(Of String, String)
 In openWith
            Console.WriteLine("Key = {0}, Value = {1}",
 _
                kvp.Key, kvp.Value)
        Next kvp
        // To get the values alone, use the Values property.
        SortedDictionary<string, string>.ValueCollection
 valueColl = 
            openWith.Values;

        // The elements of the ValueCollection are strongly typed
        // with the type that was specified for dictionary values.
        Console.WriteLine();
        foreach( string s in
 valueColl )
        {
            Console.WriteLine("Value = {0}", s);
        }
<br /><span space="preserve">...</span><br /> 
       // When you use foreach to enumerate dictionary elements,
        // the elements are retrieved as KeyValuePair objects.
        Console.WriteLine();
        foreach( KeyValuePair<string, string>
 kvp in openWith )
        {
            Console.WriteLine("Key = {0}, Value = {1}", 
                kvp.Key, kvp.Value);
        }
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SortedDictionary ジェネリック クラス
SortedDictionary メンバ
System.Collections.Generic 名前空間
SortedDictionary.ValueCollection
SortedDictionary.Keys プロパティ


このページでは「.NET Framework クラス ライブラリ リファレンス」からSortedDictionary.Values プロパティを検索した結果を表示しています。
Weblioに収録されているすべての辞書からSortedDictionary.Values プロパティを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からSortedDictionary.Values プロパティ を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

「SortedDictionary.Values プロパティ」の関連用語

SortedDictionary.Values プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SortedDictionary.Values プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS