Nullable.Compare ジェネリック メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > Nullable.Compare ジェネリック メソッドの意味・解説 

Nullable.Compare ジェネリック メソッド

メモ : このメソッドは、.NET Framework version 2.0新しく追加されたものです。

2 つNullable オブジェクト相対値比較します。

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

<ComVisibleAttribute(True)> _
Public Shared Function Compare(Of
 T As Structure) ( _
    n1 As Nullable(Of T), _
    n2 As Nullable(Of T) _
) As Integer
Dim n1 As Nullable(Of T)
Dim n2 As Nullable(Of T)
Dim returnValue As Integer

returnValue = Nullable.Compare(n1, n2)
[ComVisibleAttribute(true)] 
public static int Compare<T>
 (
    Nullable<T> n1,
    Nullable<T> n2
) where T : struct
[ComVisibleAttribute(true)] 
public:
generic<typename T> where T : ValueType
static int Compare (
    Nullable<T> n1, 
    Nullable<T> n2
)
J# では、ジェネリックな型およびメソッド使用できますが、新規に宣言することはできません。
JScript では、ジェネリックな型およびメソッド使用できません。

パラメータ

n1

Nullable オブジェクト

n2

Nullable オブジェクト

戻り値
n1 パラメータn2 パラメータ相対値を表す整数

戻り値

説明

0 より小さい値

n1 の HasValue プロパティfalse であり、n2HasValue プロパティtrue です。

または

n1n2HasValue プロパティtrue であり、n1Value プロパティの値が、n2Value プロパティの値よりも小さい値です。

0

n1n2HasValue プロパティfalse です。

または

n1n2HasValue プロパティが、true であり、n1Value プロパティの値が、n2Value プロパティの値と同じです。

0 より大きい

n1HasValue プロパティtrue であり、n2HasValue プロパティfalse です。

または

n1n2HasValue プロパティtrue であり、n1Value プロパティの値が、n2Value プロパティの値よりも大きい値です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照



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

辞書ショートカット

すべての辞書の索引

Nullable.Compare ジェネリック メソッドのお隣キーワード
検索ランキング

   

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



Nullable.Compare ジェネリック メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS