Package ghidra.program.model.data

# Class DataTypeObjectComparator

java.lang.Object
ghidra.program.model.data.DataTypeObjectComparator

All Implemented Interfaces:
  `Comparator<Object>`

public class DataTypeObjectComparator extends Object implements Comparator<Object>
`DataTypeObjectComparator` provides the preferred named-based comparison of data types using the `DataTypeNameComparator` allowing a mix of `DataType` and/or `String` names to be compared.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static DataTypeObjectComparator`
  `INSTANCE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `DataTypeObjectComparator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `int`
  `compare(Object o1, Object o2)`
  Compare two data type names

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface java.util.Comparator

  `equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- ## Field Details

  - ### INSTANCE

    public static DataTypeObjectComparator INSTANCE

- ## Constructor Details

  - ### DataTypeObjectComparator

    public DataTypeObjectComparator()

- ## Method Details

  - ### compare

    public int compare(Object o1, Object o2)
    Compare two data type names
    Specified by:
      `compare` in interface `Comparator<Object>`
    Parameters:
      `o1` - the first `DataType` or `String` name to be compared.
      `o2` - the second `DataType` or `String` name to be compared.
    Returns:
      a negative integer, zero, or a positive integer as the first argument is less than, equal to, or greater than the second.
    Throws:
      `IllegalArgumentException` - if object types other than `DataType` or `String` are compared.