comparisonとは? わかりやすく解説

Weblio 辞書 > 辞書・百科事典 > 日本語表現辞典 > comparisonの意味・解説 

comparison

別表記:コンパリソン

「comparison」の意味

「comparison」とは、二つ上の物事比較して類似点相違点を見つけることである。比較は、物事特徴性能評価し理解を深めるために行われる例えば、商品価格性能比較して購入検討したり、文学作品テーマ表現手法比較して解釈を行うことが挙げられる

「comparison」の発音・読み方

「comparison」の発音は、/kəmˈpærɪsən/であり、IPAカタカナ読みでは「カムパリソン」となる。日本人発音するカタカナ英語では「コンパリソン」と読むことが一般的である。

「comparison」の定義を英語で解説

A comparison is the act of examining two or more things in order to determine their similarities and differences. Comparisons are often made to evaluate the characteristics or performance of objects, ideas, or people, and to gain a deeper understanding of them.

「comparison」の類語

「comparison」の類語として、「contrast」や「similarity」がある。「contrast」は、二つ上の物事違い強調して比較することを意味し、「similarity」は、二つ上の物事類似点を指す。

「comparison」に関連する用語・表現

「comparison」に関連する用語表現には、「compare」という動詞がある。これは、「comparison」を行うことを意味するまた、comparative」という形容詞は、比較結果を表す言葉である。

「comparison」の例文

1. The comparison between the two products showed that Product A is more cost-effective.(二つ製品比較した結果製品Aの方がコストパフォーマンス良いことがわかった。) 2. By making a comparison of the two cities, we can see the differences in their cultures.(二つ都市比較することで、それぞれの文化の違い見えてくる。) 3. The comparison of the test results revealed the students' progress.(テスト結果比較によって、生徒たち進歩明らかになった。) 4. The comparison of the two paintings allows us to appreciate the artists' unique styles.(二つ絵画比較することで、それぞれの画家の独自のスタイル理解できる。) 5. The comparison between the old and new versions of the software highlighted the improvements made.(ソフトウェアの古いバージョン新しバージョン比較することで、改善点浮き彫りになった。) 6. The comparison of the two athletes' performances showed their strengths and weaknesses.(二人選手パフォーマンス比較することで、それぞれの強みと弱み分かった。) 7. A comparison of the economic systems of different countries can provide insights into their development.(異なる国の経済システム比較することで、それらの発展に関する洞察得られる。) 8. The comparison of the two novels revealed similarities in their themes and narrative techniques.(二つ小説比較することで、テーマ語り技法類似点見つかった。) 9. The comparison of the data sets helped us identify trends and patterns.(データセット比較によって、トレンドパターン特定することができた。) 10. The comparison of the two companies' financial statements showed their different approaches to business.(二つ企業財務諸表比較することで、それぞれのビジネスへのアプローチ違い分かった。)

Comparison ジェネリック デリゲート

メモ : このデリゲートは、.NET Framework version 2.0新しく追加されたものです。

同じ型の 2 つオブジェクト比較するメソッド表します

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

Public Delegate Function
 Comparison(Of T) ( _
    x As T, _
    y As T _
) As Integer
Dim instance As New Comparison(Of
 T)(AddressOf HandlerMethod)
public delegate int Comparison<T> (
    T x,
    T y
)
J# では、ジェネリックな型およびメソッド使用できますが、新規に宣言することはできません。
JScript では、ジェネリックな型およびメソッド使用できません。

型パラメータ

T

比較するオブジェクトの型。

パラメータ

x

比較対象の第 1 オブジェクト

y

比較対象の第 2 オブジェクト

戻り値

条件

0 より小さい。

xy より小さい。

0

xy等しい。

0 より大きい

xy より大きい値です。

解説解説
使用例使用例

Sort(ジェネリック Comparison) メソッド オーバーロードComparison デリゲート使用する方法を示すコード例次に示します

このコード例は、CompareDinosByLength という名前の文字列代替比較メソッド定義してます。このメソッド次のように動作します最初に比較対象値が null 参照 (Visual Basic では Nothing) であるかがテストされnull 参照null 以外の値よりも小さなものとして扱われます。2 番目に、文字列長が比較され、より長い文字列は、より大きなものと判断されます。3 番目に、長さ等し場合は、通常の文字列比較使用されます。

文字列List作成され4 つ文字列不特定の順序設定されます。リストには、空の文字列および null 参照含まれます。このリスト表示されCompareDinosByLength メソッドを表す Comparison 汎用デリゲート使用してソートされ、再度表示されます。

Imports System
Imports System.Collections.Generic

Public Class Example

    Private Shared Function
 CompareDinosByLength( _
        ByVal x As String,
 ByVal y As String) As
 Integer

        If x Is Nothing
 Then
            If y Is Nothing
 Then 
                ' If x is Nothing and y is Nothing, they're
                ' equal. 
                Return 0
            Else
                ' If x is Nothing and y is not Nothing, y
                ' is greater. 
                Return -1
            End If
        Else
            ' If x is not Nothing...
            '
            If y Is Nothing
 Then
                ' ...and y is Nothing, x is greater.
                Return 1
            Else
                ' ...and y is not Nothing, compare the 
                ' lengths of the two strings.
                '
                Dim retval As Integer
 = _
                    x.Length.CompareTo(y.Length)

                If retval <> 0 Then 
                    ' If the strings are not of equal length,
                    ' the longer string is greater.
                    '
                    Return retval
                Else
                    ' If the strings are of equal length,
                    ' sort them with ordinary string comparison.
                    '
                    Return x.CompareTo(y)
                End If
            End If
        End If

    End Function

    Public Shared Sub Main()

        Dim dinosaurs As New
 List(Of String)
        dinosaurs.Add("Pachycephalosaurus")
        dinosaurs.Add("Amargasaurus")
        dinosaurs.Add("")
        dinosaurs.Add(Nothing)
        dinosaurs.Add("Mamenchisaurus")
        dinosaurs.Add("Deinonychus")
        Display(dinosaurs)

        Console.WriteLine(vbLf & "Sort with generic Comparison(Of
 String) delegate:")
        dinosaurs.Sort(AddressOf CompareDinosByLength)
        Display(dinosaurs)

    End Sub

    Private Shared Sub Display(ByVal
 lis As List(Of String))
        Console.WriteLine()
        For Each s As String
 In lis
            If s Is Nothing
 Then
                Console.WriteLine("(Nothing)")
            Else
                Console.WriteLine("""{0}""",
 s)
            End If
        Next
    End Sub
End Class

' This code example produces the following output:
'
'"Pachycephalosaurus"
'"Amargasaurus"
'""
'(Nothing)
'"Mamenchisaurus"
'"Deinonychus"
'
'Sort with generic Comparison(Of String) delegate:
'
'(Nothing)
'""
'"Deinonychus"
'"Amargasaurus"
'"Mamenchisaurus"
'"Pachycephalosaurus"
using System;
using System.Collections.Generic;

public class Example
{
    private static int CompareDinosByLength(string
 x, string y)
    {
        if (x == null)
        {
            if (y == null)
            {
                // If x is null and y is null, they're
                // equal. 
                return 0;
            }
            else
            {
                // If x is null and y is not null, y
                // is greater. 
                return -1;
            }
        }
        else
        {
            // If x is not null...
            //
            if (y == null)
                // ...and y is null, x is greater.
            {
                return 1;
            }
            else
            {
                // ...and y is not null, compare the 
                // lengths of the two strings.
                //
                int retval = x.Length.CompareTo(y.Length);

                if (retval != 0)
                {
                    // If the strings are not of equal length,
                    // the longer string is greater.
                    //
                    return retval;
                }
                else
                {
                    // If the strings are of equal length,
                    // sort them with ordinary string comparison.
                    //
                    return x.CompareTo(y);
                }
            }
        }
    }

    public static void Main()
    {
        List<string> dinosaurs = new
 List<string>();
        dinosaurs.Add("Pachycephalosaurus");
        dinosaurs.Add("Amargasaurus");
        dinosaurs.Add("");
        dinosaurs.Add(null);
        dinosaurs.Add("Mamenchisaurus");
        dinosaurs.Add("Deinonychus");
        Display(dinosaurs);

        Console.WriteLine("\nSort with generic Comparison<string>
 delegate:");
        dinosaurs.Sort(CompareDinosByLength);
        Display(dinosaurs);

    }

    private static void
 Display(List<string> list)
    {
        Console.WriteLine();
        foreach( string s in
 list )
        {
            if (s == null)
                Console.WriteLine("(null)");
            else
                Console.WriteLine("\"{0}\"", s);
        }
    }
}

/* This code example produces the following output:

"Pachycephalosaurus"
"Amargasaurus"
""
(null)
"Mamenchisaurus"
"Deinonychus"

Sort with generic Comparison<string> delegate:

(null)
""
"Deinonychus"
"Amargasaurus"
"Mamenchisaurus"
"Pachycephalosaurus"
 */
using namespace System;
using namespace System::Collections::Generic;

int CompareDinosByLength(String^ x, String^ y)
{
    if (x == nullptr)
    {
        if (y == nullptr)
        {
            // If x is null and y is null, they're
            // equal. 
            return 0;
        }
        else
        {
            // If x is null and y is not null, y
            // is greater. 
            return -1;
        }
    }
    else
    {
        // If x is not null...
        //
        if (y == nullptr)
            // ...and y is null, x is greater.
        {
            return 1;
        }
        else
        {
            // ...and y is not null, compare the 
            // lengths of the two strings.
            //
            int retval = x->Length.CompareTo(y->Length);

            if (retval != 0)
            {
                // If the strings are not of equal length,
                // the longer string is greater.
                //
                return retval;
            }
            else
            {
                // If the strings are of equal length,
                // sort them with ordinary string comparison.
                //
                return x->CompareTo(y);
            }
        }
    }
};

void Display(List<String^>^ list)
{
    Console::WriteLine();
    for each(String^ s in list)
    {
        if (s == nullptr)
            Console::WriteLine("(null)");
        else
            Console::WriteLine("\"{0}\"", s);
    }
};

void main()
{
    List<String^>^ dinosaurs = gcnew List<String^>();
    dinosaurs->Add("Pachycephalosaurus");
    dinosaurs->Add("Amargasaurus");
    dinosaurs->Add("");
    dinosaurs->Add(nullptr);
    dinosaurs->Add("Mamenchisaurus");
    dinosaurs->Add("Deinonychus");
    Display(dinosaurs);

    Console::WriteLine("\nSort with generic Comparison<String^> delegate:");
    dinosaurs->Sort(
        gcnew Comparison<String^>(CompareDinosByLength));
    Display(dinosaurs);

}

/* This code example produces the following output:

"Pachycephalosaurus"
"Amargasaurus"
""
(null)
"Mamenchisaurus"
"Deinonychus"

Sort with generic Comparison<String^> delegate:

(null)
""
"Deinonychus"
"Amargasaurus"
"Mamenchisaurus"
"Pachycephalosaurus"
 */
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

比較

(comparison から転送)

出典: フリー百科事典『ウィキペディア(Wikipedia)』 (2022/03/18 01:09 UTC 版)

ナビゲーションに移動 検索に移動
ウィキペディアには「比較」という見出しの百科事典記事はありませんタイトルに「比較」を含むページの一覧/「比較」で始まるページの一覧
代わりにウィクショナリーのページ「比較」が役に立つかも知れません。

関連項目





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

辞書ショートカット

すべての辞書の索引

「comparison」の関連用語

comparisonのお隣キーワード
検索ランキング

   

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



comparisonのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
実用日本語表現辞典実用日本語表現辞典
Copyright © 2024実用日本語表現辞典 All Rights Reserved.
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2024 Microsoft.All rights reserved.
ウィキペディアウィキペディア
All text is available under the terms of the GNU Free Documentation License.
この記事は、ウィキペディアの比較 (改訂履歴)の記事を複製、再配布したものにあたり、GNU Free Documentation Licenseというライセンスの下で提供されています。 Weblio辞書に掲載されているウィキペディアの記事も、全てGNU Free Documentation Licenseの元に提供されております。

©2024 GRAS Group, Inc.RSS