Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/java/lang/Comparable#pubmethods)

# Comparable


`
public


interface
Comparable
`


`


`

|---|
| java.lang.Comparable\<T\> |

Known indirect subclasses [AbstractChronology](https://developer.android.com/reference/java/time/chrono/AbstractChronology), [AccessMode](https://developer.android.com/reference/java/nio/file/AccessMode), [AclEntryFlag](https://developer.android.com/reference/java/nio/file/attribute/AclEntryFlag), [AclEntryPermission](https://developer.android.com/reference/java/nio/file/attribute/AclEntryPermission), [AclEntryType](https://developer.android.com/reference/java/nio/file/attribute/AclEntryType), [Allocation.MipmapControl](https://developer.android.com/reference/android/renderscript/Allocation.MipmapControl), [AlphabeticIndex.Bucket.LabelType](https://developer.android.com/reference/android/icu/text/AlphabeticIndex.Bucket.LabelType), [AsyncTask.Status](https://developer.android.com/reference/android/os/AsyncTask.Status), [Authenticator.RequestorType](https://developer.android.com/reference/java/net/Authenticator.RequestorType), [BigDecimal](https://developer.android.com/reference/android/icu/math/BigDecimal), [BigInteger](https://developer.android.com/reference/java/math/BigInteger), [Bitmap.CompressFormat](https://developer.android.com/reference/android/graphics/Bitmap.CompressFormat), [Bitmap.Config](https://developer.android.com/reference/android/graphics/Bitmap.Config), [BlendMode](https://developer.android.com/reference/android/graphics/BlendMode), [BloodGlucose](https://developer.android.com/reference/android/health/connect/datatypes/units/BloodGlucose), and 256 others. [AbstractChronology](https://developer.android.com/reference/java/time/chrono/AbstractChronology) An abstract implementation of a calendar system, used to organize and identify dates. [AccessMode](https://developer.android.com/reference/java/nio/file/AccessMode) Defines access modes used to test the accessibility of a file. [AclEntryFlag](https://developer.android.com/reference/java/nio/file/attribute/AclEntryFlag) Defines the flags for used by the flags component of an ACL `https://developer.android.com/reference/java/nio/file/attribute/AclEntry`. [AclEntryPermission](https://developer.android.com/reference/java/nio/file/attribute/AclEntryPermission) Defines the permissions for use with the permissions component of an ACL `https://developer.android.com/reference/java/nio/file/attribute/AclEntry`. [AclEntryType](https://developer.android.com/reference/java/nio/file/attribute/AclEntryType) A typesafe enumeration of the access control entry types. [Allocation.MipmapControl](https://developer.android.com/reference/android/renderscript/Allocation.MipmapControl) Controls mipmap behavior when using the bitmap creation and update functions. [AlphabeticIndex.Bucket.LabelType](https://developer.android.com/reference/android/icu/text/AlphabeticIndex.Bucket.LabelType) Type of the label [AsyncTask.Status](https://developer.android.com/reference/android/os/AsyncTask.Status) Indicates the current status of the task. [Authenticator.RequestorType](https://developer.android.com/reference/java/net/Authenticator.RequestorType) The type of the entity requesting authentication. [BigDecimal](https://developer.android.com/reference/android/icu/math/BigDecimal) The `BigDecimal` class implements immutable arbitrary-precision decimal numbers. [BigInteger](https://developer.android.com/reference/java/math/BigInteger) Immutable arbitrary-precision integers. [Bitmap.CompressFormat](https://developer.android.com/reference/android/graphics/Bitmap.CompressFormat) Specifies the known formats a bitmap can be compressed into [Bitmap.Config](https://developer.android.com/reference/android/graphics/Bitmap.Config) Possible bitmap configurations. [BlendMode](https://developer.android.com/reference/android/graphics/BlendMode) [BloodGlucose](https://developer.android.com/reference/android/health/connect/datatypes/units/BloodGlucose) Represents a unit of blood glucose level (glycaemia). [BlurMaskFilter.Blur](https://developer.android.com/reference/android/graphics/BlurMaskFilter.Blur) [Boolean](https://developer.android.com/reference/java/lang/Boolean) The Boolean class wraps a value of the primitive type `boolean` in an object. [BuddhistCalendar](https://developer.android.com/reference/android/icu/util/BuddhistCalendar) `BuddhistCalendar` is a subclass of `GregorianCalendar` that numbers years since the birth of the Buddha. [Byte](https://developer.android.com/reference/java/lang/Byte) The `Byte` class wraps a value of primitive type `byte` in an object. [ByteBuffer](https://developer.android.com/reference/java/nio/ByteBuffer) A byte buffer. [CRLReason](https://developer.android.com/reference/java/security/cert/CRLReason) The CRLReason enumeration specifies the reason that a certificate is revoked, as defined in [RFC 5280: Internet X.509 Public Key Infrastructure Certificate and CRL
Profile](http://tools.ietf.org/html/rfc5280). [Calendar](https://developer.android.com/reference/java/util/Calendar) The `Calendar` class is an abstract class that provides methods for converting between a specific instant in time and a set of `https://developer.android.com/reference/java/util/Calendar#fields` such as `YEAR`, `MONTH`, `DAY_OF_MONTH`, `HOUR`, and so on, and for manipulating the calendar fields, such as getting the date of the next week. [Canvas.EdgeType](https://developer.android.com/reference/android/graphics/Canvas.EdgeType) *This enum was deprecated
in API level 30.
quickReject no longer uses this.* [Canvas.VertexMode](https://developer.android.com/reference/android/graphics/Canvas.VertexMode) [CertPathValidatorException.BasicReason](https://developer.android.com/reference/java/security/cert/CertPathValidatorException.BasicReason) The BasicReason enumerates the potential reasons that a certification path of any type may be invalid. [CharBuffer](https://developer.android.com/reference/java/nio/CharBuffer) A char buffer. [Character](https://developer.android.com/reference/java/lang/Character) The `Character` class is the [wrapper class](https://developer.android.com/reference/java/lang/package-summary) for values of the primitive type `char`. [Character.UnicodeScript](https://developer.android.com/reference/java/lang/Character.UnicodeScript) A family of character subsets representing the character scripts defined in the [*Unicode Standard Annex #24: Script Names*](http://www.unicode.org/reports/tr24/). [Charset](https://developer.android.com/reference/java/nio/charset/Charset) A named mapping between sequences of sixteen-bit Unicode [code units](https://developer.android.com/reference/lang/Character.html#unicode) and sequences of bytes. [CheckBoxPreference](https://developer.android.com/reference/android/preference/CheckBoxPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [ChineseCalendar](https://developer.android.com/reference/android/icu/util/ChineseCalendar) `ChineseCalendar` is a concrete subclass of `https://developer.android.com/reference/android/icu/util/Calendar` that implements a traditional Chinese calendar. [ChronoField](https://developer.android.com/reference/java/time/temporal/ChronoField) A standard set of fields. [ChronoLocalDate](https://developer.android.com/reference/java/time/chrono/ChronoLocalDate) A date without time-of-day or time-zone in an arbitrary chronology, intended for advanced globalization use cases. [ChronoLocalDateTime](https://developer.android.com/reference/java/time/chrono/ChronoLocalDateTime)\<D extends [ChronoLocalDate](https://developer.android.com/reference/java/time/chrono/ChronoLocalDate)\> A date-time without a time-zone in an arbitrary chronology, intended for advanced globalization use cases. [ChronoUnit](https://developer.android.com/reference/java/time/temporal/ChronoUnit) A standard set of date periods units. [ChronoZonedDateTime](https://developer.android.com/reference/java/time/chrono/ChronoZonedDateTime)\<D extends [ChronoLocalDate](https://developer.android.com/reference/java/time/chrono/ChronoLocalDate)\> A date-time with a time-zone in an arbitrary chronology, intended for advanced globalization use cases. [Chronology](https://developer.android.com/reference/java/time/chrono/Chronology) A calendar system, used to organize and identify dates. [ClientInfoStatus](https://developer.android.com/reference/java/sql/ClientInfoStatus) Enumeration for status of the reason that a property could not be set via a call to `Connection.setClientInfo` [CollationKey](https://developer.android.com/reference/java/text/CollationKey) A `CollationKey` represents a `String` under the rules of a specific `Collator` object. [Collector.Characteristics](https://developer.android.com/reference/java/util/stream/Collector.Characteristics) Characteristics indicating properties of a `Collector`, which can be used to optimize reduction implementations. [ColorSpace.Adaptation](https://developer.android.com/reference/android/graphics/ColorSpace.Adaptation)

List of adaptation matrices that can be used for chromatic adaptation
using the von Kries transform.


[ColorSpace.Model](https://developer.android.com/reference/android/graphics/ColorSpace.Model) A color model is required by a `https://developer.android.com/reference/android/graphics/ColorSpace` to describe the way colors can be represented as tuples of numbers. [ColorSpace.Named](https://developer.android.com/reference/android/graphics/ColorSpace.Named)

List of common, named color spaces.


[ColorSpace.RenderIntent](https://developer.android.com/reference/android/graphics/ColorSpace.RenderIntent) A render intent determines how a `https://developer.android.com/reference/android/graphics/ColorSpace.Connector`
maps colors from one color space to another.


[CompactDecimalFormat.CompactStyle](https://developer.android.com/reference/android/icu/text/CompactDecimalFormat.CompactStyle) Style parameter for CompactDecimalFormat. [ComponentName](https://developer.android.com/reference/android/content/ComponentName) Identifier for a specific application component (`https://developer.android.com/reference/android/app/Activity`, `https://developer.android.com/reference/android/app/Service`, `https://developer.android.com/reference/android/content/BroadcastReceiver`, or `https://developer.android.com/reference/android/content/ContentProvider`) that is available. [Configuration](https://developer.android.com/reference/android/content/res/Configuration) This class describes all device configuration information that can impact the resources the application retrieves. [ConsoleMessage.MessageLevel](https://developer.android.com/reference/android/webkit/ConsoleMessage.MessageLevel) [CopticCalendar](https://developer.android.com/reference/android/icu/util/CopticCalendar) Implement the Coptic calendar system. [CryptoPrimitive](https://developer.android.com/reference/java/security/CryptoPrimitive) An enumeration of cryptographic primitives. [Currency.CurrencyUsage](https://developer.android.com/reference/android/icu/util/Currency.CurrencyUsage) Currency Usage used for Decimal Format [CursorJoiner.Result](https://developer.android.com/reference/android/database/CursorJoiner.Result) The result of a call to next(). [Date](https://developer.android.com/reference/java/util/Date) The class `Date` represents a specific instant in time, with millisecond precision. [DateFormat.BooleanAttribute](https://developer.android.com/reference/android/icu/text/DateFormat.BooleanAttribute) boolean attributes [DateFormat.HourCycle](https://developer.android.com/reference/android/icu/text/DateFormat.HourCycle) Hour Cycle [DateTimePatternGenerator.DisplayWidth](https://developer.android.com/reference/android/icu/text/DateTimePatternGenerator.DisplayWidth) Field display name width constants for getFieldDisplayName [DayOfWeek](https://developer.android.com/reference/java/time/DayOfWeek) A day-of-week, such as 'Tuesday'. [Delayed](https://developer.android.com/reference/java/util/concurrent/Delayed) A mix-in style interface for marking objects that should be acted upon after a given delay. [DialogPreference](https://developer.android.com/reference/android/preference/DialogPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [DisplayContext](https://developer.android.com/reference/android/icu/text/DisplayContext) Display context settings. [DisplayContext.Type](https://developer.android.com/reference/android/icu/text/DisplayContext.Type) Type values for DisplayContext [DisplayOptions.Capitalization](https://developer.android.com/reference/android/icu/text/DisplayOptions.Capitalization) Represents all the capitalization options. [DisplayOptions.DisplayLength](https://developer.android.com/reference/android/icu/text/DisplayOptions.DisplayLength) Represents all the display lengths. [DisplayOptions.GrammaticalCase](https://developer.android.com/reference/android/icu/text/DisplayOptions.GrammaticalCase) Represents all the grammatical cases that are supported by CLDR. [DisplayOptions.NameStyle](https://developer.android.com/reference/android/icu/text/DisplayOptions.NameStyle) Represents all the name styles. [DisplayOptions.NounClass](https://developer.android.com/reference/android/icu/text/DisplayOptions.NounClass) Represents all the grammatical noun classes that are supported by CLDR. [DisplayOptions.PluralCategory](https://developer.android.com/reference/android/icu/text/DisplayOptions.PluralCategory) Standard CLDR plural category constants. [DisplayOptions.SubstituteHandling](https://developer.android.com/reference/android/icu/text/DisplayOptions.SubstituteHandling) Represents all the substitute handlings. [Double](https://developer.android.com/reference/java/lang/Double) The `Double` class wraps a value of the primitive type `double` in an object. [DoubleBuffer](https://developer.android.com/reference/java/nio/DoubleBuffer) A double buffer. [DrbgParameters.Capability](https://developer.android.com/reference/java/security/DrbgParameters.Capability) The reseedable and prediction resistance capabilities of a DRBG. [Duration](https://developer.android.com/reference/java/time/Duration) A time-based amount of time, such as '34.5 seconds'. [EditTextPreference](https://developer.android.com/reference/android/preference/EditTextPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [Element.DataKind](https://developer.android.com/reference/android/renderscript/Element.DataKind) The special interpretation of the data if required. [Element.DataType](https://developer.android.com/reference/android/renderscript/Element.DataType) DataType represents the basic type information for a basic element. [ElementType](https://developer.android.com/reference/java/lang/annotation/ElementType) The constants of this enumerated class provide a simple classification of the syntactic locations where annotations may appear in a Java program. [EmergencyNumber](https://developer.android.com/reference/android/telephony/emergency/EmergencyNumber) A parcelable class that wraps and retrieves the information of number, service category(s) and country code for a specific emergency number. [Energy](https://developer.android.com/reference/android/health/connect/datatypes/units/Energy) Represents a unit of energy. [Enum](https://developer.android.com/reference/java/lang/Enum)\<E extends [Enum](https://developer.android.com/reference/java/lang/Enum)\<E\>\> This is the common base class of all Java language enumeration classes. [EthiopicCalendar](https://developer.android.com/reference/android/icu/util/EthiopicCalendar) Implement the Ethiopic calendar system. [File](https://developer.android.com/reference/java/io/File) An abstract representation of file and directory pathnames. [FileTime](https://developer.android.com/reference/java/nio/file/attribute/FileTime) Represents the value of a file's time stamp attribute. [FileVisitOption](https://developer.android.com/reference/java/nio/file/FileVisitOption) Defines the file tree traversal options. [FileVisitResult](https://developer.android.com/reference/java/nio/file/FileVisitResult) The result type of a `https://developer.android.com/reference/java/nio/file/FileVisitor`. [Float](https://developer.android.com/reference/java/lang/Float) The `Float` class wraps a value of primitive type `float` in an object. [FloatBuffer](https://developer.android.com/reference/java/nio/FloatBuffer) A float buffer. [FormatStyle](https://developer.android.com/reference/java/time/format/FormatStyle) Enumeration of the style of a localized date, time or date-time formatter. [Formatter.BigDecimalLayoutForm](https://developer.android.com/reference/java/util/Formatter.BigDecimalLayoutForm) Enum for `BigDecimal` formatting. [Future.State](https://developer.android.com/reference/java/util/concurrent/Future.State) Represents the computation state. [GradientDrawable.Orientation](https://developer.android.com/reference/android/graphics/drawable/GradientDrawable.Orientation) Controls how the gradient is oriented relative to the drawable's bounds [GregorianCalendar](https://developer.android.com/reference/java/util/GregorianCalendar) `GregorianCalendar` is a concrete subclass of `Calendar` and provides the standard calendar system used by most of the world. [Half](https://developer.android.com/reference/android/util/Half) The `Half` class is a wrapper and a utility class to manipulate half-precision 16-bit
[IEEE 754](https://en.wikipedia.org/wiki/Half-precision_floating-point_format)
floating point data types (also called fp16 or binary16).


[HebrewCalendar](https://developer.android.com/reference/android/icu/util/HebrewCalendar) `HebrewCalendar` is a subclass of `Calendar` that that implements the traditional Hebrew calendar. [HijrahChronology](https://developer.android.com/reference/java/time/chrono/HijrahChronology) The Hijrah calendar is a lunar calendar supporting Islamic calendars. [HijrahDate](https://developer.android.com/reference/java/time/chrono/HijrahDate) A date in the Hijrah calendar system. [HijrahEra](https://developer.android.com/reference/java/time/chrono/HijrahEra) An era in the Hijrah calendar system. [IDNA.Error](https://developer.android.com/reference/android/icu/text/IDNA.Error) IDNA error bit set values. [ImageView.ScaleType](https://developer.android.com/reference/android/widget/ImageView.ScaleType) Options for scaling the bounds of an image to the bounds of this view. [IndianCalendar](https://developer.android.com/reference/android/icu/util/IndianCalendar) `IndianCalendar` is a subclass of `GregorianCalendar` that numbers years since the birth of the Buddha. [Instant](https://developer.android.com/reference/java/time/Instant) An instantaneous point on the time-line. [IntBuffer](https://developer.android.com/reference/java/nio/IntBuffer) An int buffer. [Integer](https://developer.android.com/reference/java/lang/Integer) The `Integer` class wraps a value of the primitive type `int` in an object. [Interpolator.Result](https://developer.android.com/reference/android/graphics/Interpolator.Result) [IslamicCalendar](https://developer.android.com/reference/android/icu/util/IslamicCalendar) `IslamicCalendar` is a subclass of `Calendar` that that implements the Islamic civil and religious calendars. [IslamicCalendar.CalculationType](https://developer.android.com/reference/android/icu/util/IslamicCalendar.CalculationType) enumeration of available calendar calculation types [IsoChronology](https://developer.android.com/reference/java/time/chrono/IsoChronology) The ISO calendar system. [IsoEra](https://developer.android.com/reference/java/time/chrono/IsoEra) An era in the ISO calendar system. [JapaneseCalendar](https://developer.android.com/reference/android/icu/util/JapaneseCalendar) `JapaneseCalendar` is a subclass of `GregorianCalendar` that numbers years and eras based on the reigns of the Japanese emperors. [JapaneseChronology](https://developer.android.com/reference/java/time/chrono/JapaneseChronology) The Japanese Imperial calendar system. [JapaneseDate](https://developer.android.com/reference/java/time/chrono/JapaneseDate) A date in the Japanese Imperial calendar system. [JsonToken](https://developer.android.com/reference/android/util/JsonToken) A structure, name or value type in a JSON-encoded string. [KeyRep.Type](https://developer.android.com/reference/java/security/KeyRep.Type) Key type. [Layout.Alignment](https://developer.android.com/reference/android/text/Layout.Alignment) [Length](https://developer.android.com/reference/android/health/connect/datatypes/units/Length) Represents a unit of length. [LinkOption](https://developer.android.com/reference/java/nio/file/LinkOption) Defines the options as to how symbolic links are handled. [ListFormatter.Type](https://developer.android.com/reference/android/icu/text/ListFormatter.Type) Type of meaning expressed by the list. [ListFormatter.Width](https://developer.android.com/reference/android/icu/text/ListFormatter.Width) Verbosity level of the list patterns. [ListPreference](https://developer.android.com/reference/android/preference/ListPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [LocalDate](https://developer.android.com/reference/java/time/LocalDate) A date without a time-zone in the ISO-8601 calendar system, such as `2007-12-03`. [LocalDateTime](https://developer.android.com/reference/java/time/LocalDateTime) A date-time without a time-zone in the ISO-8601 calendar system, such as `2007-12-03T10:15:30`. [LocalSocketAddress.Namespace](https://developer.android.com/reference/android/net/LocalSocketAddress.Namespace) The namespace that this address exists in. [LocalTime](https://developer.android.com/reference/java/time/LocalTime) A time without a time-zone in the ISO-8601 calendar system, such as `10:15:30`. [Locale.Category](https://developer.android.com/reference/java/util/Locale.Category) Enum for locale categories. [Locale.FilteringMode](https://developer.android.com/reference/java/util/Locale.FilteringMode) This enum provides constants to select a filtering mode for locale matching. [Locale.IsoCountryCode](https://developer.android.com/reference/java/util/Locale.IsoCountryCode) Enum for specifying the type defined in ISO 3166. [LocaleDisplayNames.DialectHandling](https://developer.android.com/reference/android/icu/text/LocaleDisplayNames.DialectHandling) Enum used in `https://developer.android.com/reference/android/icu/text/LocaleDisplayNames#getInstance(android.icu.util.ULocale,%20android.icu.text.LocaleDisplayNames.DialectHandling)`. [Long](https://developer.android.com/reference/java/lang/Long) The `Long` class wraps a value of the primitive type `long` in an object. [LongBuffer](https://developer.android.com/reference/java/nio/LongBuffer) A long buffer. [MappedByteBuffer](https://developer.android.com/reference/java/nio/MappedByteBuffer) A direct byte buffer whose content is a memory-mapped region of a file. [Mass](https://developer.android.com/reference/android/health/connect/datatypes/units/Mass) Represents a unit of mass. [Matrix.ScaleToFit](https://developer.android.com/reference/android/graphics/Matrix.ScaleToFit) Controls how the src rect should align into the dst rect for setRectToRect(). [MeasureFormat.FormatWidth](https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth) Formatting width enum. [MeasureUnit.Complexity](https://developer.android.com/reference/android/icu/util/MeasureUnit.Complexity) Enumeration for unit complexity. [MeasureUnit.MeasurePrefix](https://developer.android.com/reference/android/icu/util/MeasureUnit.MeasurePrefix) Enumeration for SI and binary prefixes, e.g. "kilo-", "nano-", "mebi-". [MessagePattern.ApostropheMode](https://developer.android.com/reference/android/icu/text/MessagePattern.ApostropheMode) Mode for when an apostrophe starts quoted literal text for MessageFormat output. [MessagePattern.ArgType](https://developer.android.com/reference/android/icu/text/MessagePattern.ArgType) Argument type constants. [MessagePattern.Part.Type](https://developer.android.com/reference/android/icu/text/MessagePattern.Part.Type) Part type constants. [MinguoChronology](https://developer.android.com/reference/java/time/chrono/MinguoChronology) The Minguo calendar system. [MinguoDate](https://developer.android.com/reference/java/time/chrono/MinguoDate) A date in the Minguo calendar system. [MinguoEra](https://developer.android.com/reference/java/time/chrono/MinguoEra) An era in the Minguo calendar system. [Month](https://developer.android.com/reference/java/time/Month) A month-of-year, such as 'July'. [MonthDay](https://developer.android.com/reference/java/time/MonthDay) A month-day in the ISO-8601 calendar system, such as `--12-03`. [MultiSelectListPreference](https://developer.android.com/reference/android/preference/MultiSelectListPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [NetworkInfo.DetailedState](https://developer.android.com/reference/android/net/NetworkInfo.DetailedState) *This enum was deprecated
in API level 29.
See `https://developer.android.com/reference/android/net/NetworkInfo`.* [NetworkInfo.State](https://developer.android.com/reference/android/net/NetworkInfo.State) *This enum was deprecated
in API level 29.
See `https://developer.android.com/reference/android/net/NetworkInfo`.* [Normalizer.Form](https://developer.android.com/reference/java/text/Normalizer.Form) This enum provides constants of the four Unicode normalization forms that are described in [Unicode Standard Annex #15 --- Unicode Normalization Forms](https://www.unicode.org/reports/tr15/) and two methods to access them. [Normalizer2.Mode](https://developer.android.com/reference/android/icu/text/Normalizer2.Mode) Constants for normalization modes. [NumberFormatter.DecimalSeparatorDisplay](https://developer.android.com/reference/android/icu/number/NumberFormatter.DecimalSeparatorDisplay) An enum declaring how to render the decimal separator. [NumberFormatter.GroupingStrategy](https://developer.android.com/reference/android/icu/number/NumberFormatter.GroupingStrategy) An enum declaring the strategy for when and how to display grouping separators (i.e., the separator, often a comma or period, after every 2-3 powers of ten). [NumberFormatter.RoundingPriority](https://developer.android.com/reference/android/icu/number/NumberFormatter.RoundingPriority) An enum declaring how to resolve conflicts between maximum fraction digits and maximum significant digits. [NumberFormatter.SignDisplay](https://developer.android.com/reference/android/icu/number/NumberFormatter.SignDisplay) An enum declaring how to denote positive and negative numbers. [NumberFormatter.TrailingZeroDisplay](https://developer.android.com/reference/android/icu/number/NumberFormatter.TrailingZeroDisplay) An enum declaring how to render trailing zeros. [NumberFormatter.UnitWidth](https://developer.android.com/reference/android/icu/number/NumberFormatter.UnitWidth) An enum declaring how to render units, including currencies. [NumberRangeFormatter.RangeCollapse](https://developer.android.com/reference/android/icu/number/NumberRangeFormatter.RangeCollapse) Defines how to merge fields that are identical across the range sign. [NumberRangeFormatter.RangeIdentityFallback](https://developer.android.com/reference/android/icu/number/NumberRangeFormatter.RangeIdentityFallback) Defines the behavior when the two numbers in the range are identical after rounding. [NumberRangeFormatter.RangeIdentityResult](https://developer.android.com/reference/android/icu/number/NumberRangeFormatter.RangeIdentityResult) Used in the result class FormattedNumberRange to indicate to the user whether the numbers formatted in the range were equal or not, and whether or not the identity fallback was applied. [NumericShaper.Range](https://developer.android.com/reference/java/awt/font/NumericShaper.Range) A `NumericShaper.Range` represents a Unicode range of a script having its own decimal digits. [ObjectStreamField](https://developer.android.com/reference/java/io/ObjectStreamField) A description of a Serializable field from a Serializable class. [OffsetDateTime](https://developer.android.com/reference/java/time/OffsetDateTime) A date-time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as `2007-12-03T10:15:30+01:00`. [OffsetTime](https://developer.android.com/reference/java/time/OffsetTime) A time with an offset from UTC/Greenwich in the ISO-8601 calendar system, such as `10:15:30+01:00`. [PKIXReason](https://developer.android.com/reference/java/security/cert/PKIXReason) The `PKIXReason` enumerates the potential PKIX-specific reasons that an X.509 certification path may be invalid according to the PKIX (RFC 5280) standard. [PKIXRevocationChecker.Option](https://developer.android.com/reference/java/security/cert/PKIXRevocationChecker.Option) Various revocation options that can be specified for the revocation checking mechanism. [Paint.Align](https://developer.android.com/reference/android/graphics/Paint.Align) Align specifies how drawText aligns its text relative to the \[x,y\] coordinates. [Paint.Cap](https://developer.android.com/reference/android/graphics/Paint.Cap) The Cap specifies the treatment for the beginning and ending of stroked lines and paths. [Paint.Join](https://developer.android.com/reference/android/graphics/Paint.Join) The Join specifies the treatment where lines and curve segments join on a stroked path. [Paint.Style](https://developer.android.com/reference/android/graphics/Paint.Style) The Style specifies if the primitive being drawn is filled, stroked, or both (in the same color). [Path](https://developer.android.com/reference/java/nio/file/Path) An object that may be used to locate a file in a file system. [Path.Direction](https://developer.android.com/reference/android/graphics/Path.Direction) Specifies how closed shapes (e.g. rects, ovals) are oriented when they are added to a path. [Path.FillType](https://developer.android.com/reference/android/graphics/Path.FillType) Enum for the ways a path may be filled. [Path.Op](https://developer.android.com/reference/android/graphics/Path.Op) The logical operations that can be performed when combining two paths. [PathDashPathEffect.Style](https://developer.android.com/reference/android/graphics/PathDashPathEffect.Style) [Percentage](https://developer.android.com/reference/android/health/connect/datatypes/units/Percentage) Represents a value as a percentage, not a fraction - for example 100%, 89.62%, etc. [PluralRules.PluralType](https://developer.android.com/reference/android/icu/text/PluralRules.PluralType) Type of plurals and PluralRules. [PorterDuff.Mode](https://developer.android.com/reference/android/graphics/PorterDuff.Mode)

The name of the parent class is an homage to the work of Thomas Porter and
Tom Duff, presented in their seminal 1984 paper titled "Compositing Digital Images".


[PosixFilePermission](https://developer.android.com/reference/java/nio/file/attribute/PosixFilePermission) Defines the bits for use with the `https://developer.android.com/reference/java/nio/file/attribute/PosixFileAttributes#permissions()` attribute. [Power](https://developer.android.com/reference/android/health/connect/datatypes/units/Power) Represents a unit of power. [Preference](https://developer.android.com/reference/android/preference/Preference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [PreferenceCategory](https://developer.android.com/reference/android/preference/PreferenceCategory) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [PreferenceGroup](https://developer.android.com/reference/android/preference/PreferenceGroup) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [PreferenceScreen](https://developer.android.com/reference/android/preference/PreferenceScreen) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [Pressure](https://developer.android.com/reference/android/health/connect/datatypes/units/Pressure) Represents a unit of pressure. [ProcessBuilder.Redirect.Type](https://developer.android.com/reference/java/lang/ProcessBuilder.Redirect.Type) The type of a `https://developer.android.com/reference/java/lang/ProcessBuilder.Redirect`. [Proxy.Type](https://developer.android.com/reference/java/net/Proxy.Type) Represents the proxy type. [Rational](https://developer.android.com/reference/android/util/Rational) An immutable data type representation a rational number.


[Region.Op](https://developer.android.com/reference/android/graphics/Region.Op) [RelativeDateTimeFormatter.AbsoluteUnit](https://developer.android.com/reference/android/icu/text/RelativeDateTimeFormatter.AbsoluteUnit) Represents an absolute unit. [RelativeDateTimeFormatter.Direction](https://developer.android.com/reference/android/icu/text/RelativeDateTimeFormatter.Direction) Represents a direction for an absolute unit e.g "Next Tuesday" or "Last Tuesday" [RelativeDateTimeFormatter.RelativeDateTimeUnit](https://developer.android.com/reference/android/icu/text/RelativeDateTimeFormatter.RelativeDateTimeUnit) Represents the unit for formatting a relative date. [RelativeDateTimeFormatter.RelativeUnit](https://developer.android.com/reference/android/icu/text/RelativeDateTimeFormatter.RelativeUnit) Represents the unit for formatting a relative date. [RelativeDateTimeFormatter.Style](https://developer.android.com/reference/android/icu/text/RelativeDateTimeFormatter.Style) The formatting style [RenderScript.ContextType](https://developer.android.com/reference/android/renderscript/RenderScript.ContextType) ContextType specifies the specific type of context to be created. [RenderScript.Priority](https://developer.android.com/reference/android/renderscript/RenderScript.Priority) RenderScript worker thread priority enumeration. [ResolverStyle](https://developer.android.com/reference/java/time/format/ResolverStyle) Enumeration of different ways to resolve dates and times. [RetentionPolicy](https://developer.android.com/reference/java/lang/annotation/RetentionPolicy) Annotation retention policy. [RingtonePreference](https://developer.android.com/reference/android/preference/RingtonePreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [RoundingMode](https://developer.android.com/reference/java/math/RoundingMode) Specifies a *rounding policy* for numerical operations capable of discarding precision. [RowIdLifetime](https://developer.android.com/reference/java/sql/RowIdLifetime) Enumeration for RowId life-time values. [RunnableScheduledFuture](https://developer.android.com/reference/java/util/concurrent/RunnableScheduledFuture)\<V\> A `https://developer.android.com/reference/java/util/concurrent/ScheduledFuture` that is `https://developer.android.com/reference/java/lang/Runnable`. [SSLEngineResult.HandshakeStatus](https://developer.android.com/reference/javax/net/ssl/SSLEngineResult.HandshakeStatus) An `SSLEngineResult` enum describing the current handshaking state of this `SSLEngine`. [SSLEngineResult.Status](https://developer.android.com/reference/javax/net/ssl/SSLEngineResult.Status) An `SSLEngineResult` enum describing the overall result of the `SSLEngine` operation. [Sampler.Value](https://developer.android.com/reference/android/renderscript/Sampler.Value) [ScheduledFuture](https://developer.android.com/reference/java/util/concurrent/ScheduledFuture)\<V\> A delayed result-bearing action that can be cancelled. [SearchIterator.ElementComparisonType](https://developer.android.com/reference/android/icu/text/SearchIterator.ElementComparisonType) Option to control how collation elements are compared. [Shader.TileMode](https://developer.android.com/reference/android/graphics/Shader.TileMode) [Short](https://developer.android.com/reference/java/lang/Short) The `Short` class wraps a value of primitive type `short` in an object. [ShortBuffer](https://developer.android.com/reference/java/nio/ShortBuffer) A short buffer. [SignStyle](https://developer.android.com/reference/java/time/format/SignStyle) Enumeration of ways to handle the positive/negative sign. [SmsMessage.MessageClass](https://developer.android.com/reference/android/telephony/SmsMessage.MessageClass) SMS Class enumeration. [StackWalker.Option](https://developer.android.com/reference/java/lang/StackWalker.Option) Stack walker option to configure the [stack frame](https://developer.android.com/reference/java/lang/StackWalker.StackFrame) information obtained by a `StackWalker`. [StandardCopyOption](https://developer.android.com/reference/java/nio/file/StandardCopyOption) Defines the standard copy options. [StandardOpenOption](https://developer.android.com/reference/java/nio/file/StandardOpenOption) Defines the standard open options. [StandardProtocolFamily](https://developer.android.com/reference/java/net/StandardProtocolFamily) Defines the standard families of communication protocols. [String](https://developer.android.com/reference/java/lang/String) The `String` class represents character strings. [StringBuffer](https://developer.android.com/reference/java/lang/StringBuffer) A thread-safe, mutable sequence of characters. [StringBuilder](https://developer.android.com/reference/java/lang/StringBuilder) A mutable sequence of characters. [StructTimespec](https://developer.android.com/reference/android/system/StructTimespec) Corresponds to C's `struct timespec` from `<time.h>`. [SupplicantState](https://developer.android.com/reference/android/net/wifi/SupplicantState) From `defs.h` in `wpa_supplicant`. [SwitchPreference](https://developer.android.com/reference/android/preference/SwitchPreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [TaiwanCalendar](https://developer.android.com/reference/android/icu/util/TaiwanCalendar) `TaiwanCalendar` is a subclass of `GregorianCalendar` that numbers years since 1912. [Temperature](https://developer.android.com/reference/android/health/connect/datatypes/units/Temperature) Represents a unit of temperature. [TemperatureDelta](https://developer.android.com/reference/android/health/connect/datatypes/units/TemperatureDelta) Represents a unit of temperature difference. [TextKeyListener.Capitalize](https://developer.android.com/reference/android/text/method/TextKeyListener.Capitalize) [TextStyle](https://developer.android.com/reference/java/time/format/TextStyle) Enumeration of the style of text formatting and parsing. [TextUtils.TruncateAt](https://developer.android.com/reference/android/text/TextUtils.TruncateAt) [TextView.BufferType](https://developer.android.com/reference/android/widget/TextView.BufferType) Type of the text buffer that defines the characteristics of the text such as static, styleable, or editable. [ThaiBuddhistChronology](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistChronology) The Thai Buddhist calendar system. [ThaiBuddhistDate](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistDate) A date in the Thai Buddhist calendar system. [ThaiBuddhistEra](https://developer.android.com/reference/java/time/chrono/ThaiBuddhistEra) An era in the Thai Buddhist calendar system. [Thread.State](https://developer.android.com/reference/java/lang/Thread.State) A thread state. [Time](https://developer.android.com/reference/java/sql/Time) A thin wrapper around the `java.util.Date` class that allows the JDBC
API to identify this as an SQL `TIME` value.


[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit) A `TimeUnit` represents time durations at a given unit of granularity and provides utility methods to convert across units, and to perform timing and delay operations in these units. [TimeZone.SystemTimeZoneType](https://developer.android.com/reference/android/icu/util/TimeZone.SystemTimeZoneType) **\[icu\]** System time zone type constants used by filtering zones in `https://developer.android.com/reference/android/icu/util/TimeZone#getAvailableIDs(android.icu.util.TimeZone.SystemTimeZoneType,%20java.lang.String,%20java.lang.Integer)` [TimeZoneFormat.GMTOffsetPatternType](https://developer.android.com/reference/android/icu/text/TimeZoneFormat.GMTOffsetPatternType) Offset pattern type enum. [TimeZoneFormat.ParseOption](https://developer.android.com/reference/android/icu/text/TimeZoneFormat.ParseOption) Parse option enum, used for specifying optional parse behavior. [TimeZoneFormat.Style](https://developer.android.com/reference/android/icu/text/TimeZoneFormat.Style) Time zone display format style enum used by format/parse APIs in `TimeZoneFormat`. [TimeZoneFormat.TimeType](https://developer.android.com/reference/android/icu/text/TimeZoneFormat.TimeType) Time type enum used for receiving time type (standard time, daylight time or unknown) in `TimeZoneFormat` APIs. [TimeZoneNames.NameType](https://developer.android.com/reference/android/icu/text/TimeZoneNames.NameType) Time zone display name types [Timestamp](https://developer.android.com/reference/java/sql/Timestamp) A thin wrapper around `java.util.Date` that allows
the JDBC API to identify this as an SQL `TIMESTAMP` value.


[TwoStatePreference](https://developer.android.com/reference/android/preference/TwoStatePreference) *This class was deprecated
in API level 29.
Use the [AndroidX](https://developer.android.com/jetpack/androidx)
[Preference Library](https://developer.android.com/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on
using the AndroidX Preference Library see
[Settings](https://developer.android.com/guide/topics/ui/settings).* [Type.CubemapFace](https://developer.android.com/reference/android/renderscript/Type.CubemapFace) [UCharacter.IdentifierType](https://developer.android.com/reference/android/icu/lang/UCharacter.IdentifierType) Identifier Type constants. [ULocale](https://developer.android.com/reference/android/icu/util/ULocale) **\[icu enhancement\]** ICU's replacement for `https://developer.android.com/reference/java/util/Locale`. Methods, fields, and other functionality specific to ICU are labeled '**\[icu\]**'. [ULocale.AvailableType](https://developer.android.com/reference/android/icu/util/ULocale.AvailableType) Types for `https://developer.android.com/reference/android/icu/util/ULocale#getAvailableLocalesByType(android.icu.util.ULocale.AvailableType)` [ULocale.Category](https://developer.android.com/reference/android/icu/util/ULocale.Category) Enum for locale categories. [URI](https://developer.android.com/reference/java/net/URI) Represents a Uniform Resource Identifier (URI) reference. [UScript.ScriptUsage](https://developer.android.com/reference/android/icu/lang/UScript.ScriptUsage) Script usage constants. [UUID](https://developer.android.com/reference/java/util/UUID) A class that represents an immutable universally unique identifier (UUID). [UnicodeSet](https://developer.android.com/reference/android/icu/text/UnicodeSet) A mutable set of Unicode characters and multicharacter strings. [UnicodeSet.ComparisonStyle](https://developer.android.com/reference/android/icu/text/UnicodeSet.ComparisonStyle) Comparison style enums used by `https://developer.android.com/reference/android/icu/text/UnicodeSet#compareTo(android.icu.text.UnicodeSet,%20android.icu.text.UnicodeSet.ComparisonStyle)`. [UnicodeSet.SpanCondition](https://developer.android.com/reference/android/icu/text/UnicodeSet.SpanCondition) Argument values for whether span() and similar functions continue while the current character is contained vs. [UnicodeSetSpanner.CountMethod](https://developer.android.com/reference/android/icu/text/UnicodeSetSpanner.CountMethod) Options for replaceFrom and countIn to control how to treat each matched span. [UnicodeSetSpanner.TrimOption](https://developer.android.com/reference/android/icu/text/UnicodeSetSpanner.TrimOption) Options for the trim() method [Uri](https://developer.android.com/reference/android/net/Uri) Immutable URI reference. [VarHandle.AccessMode](https://developer.android.com/reference/java/lang/invoke/VarHandle.AccessMode) The set of access modes that specify how a variable, referenced by a VarHandle, is accessed. [Velocity](https://developer.android.com/reference/android/health/connect/datatypes/units/Velocity) Represents a unit of speed. [VersionInfo](https://developer.android.com/reference/android/icu/util/VersionInfo) Class to store version numbers of the form major.minor.milli.micro. [ViewDebug.HierarchyTraceType](https://developer.android.com/reference/android/view/ViewDebug.HierarchyTraceType) *This enum was deprecated
in API level 16.
This enum is now unused* [ViewDebug.RecyclerTraceType](https://developer.android.com/reference/android/view/ViewDebug.RecyclerTraceType) *This enum was deprecated
in API level 16.
This enum is now unused* [Volume](https://developer.android.com/reference/android/health/connect/datatypes/units/Volume) Represents a unit of volume. [WebSettings.LayoutAlgorithm](https://developer.android.com/reference/android/webkit/WebSettings.LayoutAlgorithm) Enum for controlling the layout of html. [WebSettings.PluginState](https://developer.android.com/reference/android/webkit/WebSettings.PluginState) The plugin state effects how plugins are treated on a page. [WebSettings.RenderPriority](https://developer.android.com/reference/android/webkit/WebSettings.RenderPriority) [WebSettings.TextSize](https://developer.android.com/reference/android/webkit/WebSettings.TextSize) *This enum was deprecated
in API level 15.
Use `https://developer.android.com/reference/android/webkit/WebSettings#setTextZoom(int)` and `https://developer.android.com/reference/android/webkit/WebSettings#getTextZoom()` instead.* [WebSettings.ZoomDensity](https://developer.android.com/reference/android/webkit/WebSettings.ZoomDensity) Enum for specifying the WebView's desired density. [Xml.Encoding](https://developer.android.com/reference/android/util/Xml.Encoding) Supported character encodings. [Year](https://developer.android.com/reference/java/time/Year) A year in the ISO-8601 calendar system, such as `2007`. [YearMonth](https://developer.android.com/reference/java/time/YearMonth) A year-month in the ISO-8601 calendar system, such as `2007-12`. [ZoneOffset](https://developer.android.com/reference/java/time/ZoneOffset) A time-zone offset from Greenwich/UTC, such as `+02:00`. [ZoneOffsetTransition](https://developer.android.com/reference/java/time/zone/ZoneOffsetTransition) A transition between two offsets caused by a discontinuity in the local time-line. [ZoneOffsetTransitionRule.TimeDefinition](https://developer.android.com/reference/java/time/zone/ZoneOffsetTransitionRule.TimeDefinition) A definition of the way a local time can be converted to the actual transition date-time. [ZonedDateTime](https://developer.android.com/reference/java/time/ZonedDateTime) A date-time with a time-zone in the ISO-8601 calendar system, such as `2007-12-03T10:15:30+01:00 Europe/Paris`.   

*** ** * ** ***

This interface imposes a total ordering on the objects of each class that
implements it. This ordering is referred to as the class's *natural ordering*, and the class's `compareTo` method is referred to as
its *natural comparison method*.


Lists (and arrays) of objects that implement this interface can be sorted
automatically by `https://developer.android.com/reference/java/util/Collections#sort(java.util.List<T>)` (and
`https://developer.android.com/reference/java/util/Arrays#sort(java.lang.Object[])`). Objects that implement this
interface can be used as keys in a [sorted map](https://developer.android.com/reference/java/util/SortedMap) or as
elements in a [sorted set](https://developer.android.com/reference/java/util/SortedSet), without the need to
specify a [comparator](https://developer.android.com/reference/java/util/Comparator).


The natural ordering for a class `C` is said to be *consistent with equals* if and only if `e1.compareTo(e2) == 0` has
the same boolean value as `e1.equals(e2)` for every
`e1` and `e2` of class `C`. Note that `null`
is not an instance of any class, and `e.compareTo(null)` should
throw a `NullPointerException` even though `e.equals(null)`
returns `false`.


It is strongly recommended (though not required) that natural orderings be
consistent with equals. This is so because sorted sets (and sorted maps)
without explicit comparators behave "strangely" when they are used with
elements (or keys) whose natural ordering is inconsistent with equals. In
particular, such a sorted set (or sorted map) violates the general contract
for set (or map), which is defined in terms of the `equals`
method.


For example, if one adds two keys `a` and `b` such that
`(!a.equals(b) && a.compareTo(b) == 0)` to a sorted
set that does not use an explicit comparator, the second `add`
operation returns false (and the size of the sorted set does not increase)
because `a` and `b` are equivalent from the sorted set's
perspective.


Virtually all Java core classes that implement `Comparable`
have natural orderings that are consistent with equals. One
exception is `https://developer.android.com/reference/java/math/BigDecimal`, whose [natural ordering](https://developer.android.com/reference/java/lang/Comparable#compareTo(T)) equates `BigDecimal` objects with equal numerical values and different
representations (such as 4.0 and 4.00). For `https://developer.android.com/reference/java/math/BigDecimal#equals(java.lang.Object)` to return true,
the representation and numerical value of the two `BigDecimal` objects must be the same.


For the mathematically inclined, the *relation* that defines
the natural ordering on a given class C is:

    {(x, y) such that x.compareTo(y) <= 0}.

The *quotient* for this total order is:

    {(x, y) such that x.compareTo(y) == 0}.

It follows immediately from the contract for `compareTo` that the quotient is an *equivalence relation* on `C`, and that the natural ordering is a *total order* on `C`. When we say that a class's natural ordering is *consistent with equals*, we mean that the quotient for the natural ordering is the equivalence relation defined by the class's `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method:

```
    {(x, y) such that x.equals(y)}. 
```


In other words, when a class's natural ordering is consistent with
equals, the equivalence classes defined by the equivalence relation
of the `equals` method and the equivalence classes defined by
the quotient of the `compareTo` method are the same.

This interface is a member of the
[Java Collections Framework](https://reference/java/util/package-summary.html#CollectionsFramework).
**See also:**

- `https://developer.android.com/reference/java/util/Comparator`

## Summary

| ### Public methods ||
|---|---|
| ` abstract int` | ` https://developer.android.com/reference/java/lang/Comparable#compareTo(T)(T o) ` Compares this object with the specified object for order. |

## Public methods

### compareTo

Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)

```
public abstract int compareTo (T o)
```

Compares this object with the specified object for order. Returns a
negative integer, zero, or a positive integer as this object is less
than, equal to, or greater than the specified object.

The implementor must ensure `https://developer.android.com/reference/java/lang/Integer#signum(int)``(x.compareTo(y)) == -signum(y.compareTo(x))` for
all `x` and `y`. (This implies that `x.compareTo(y)` must throw an exception if and only if `y.compareTo(x)` throws an exception.)

The implementor must also ensure that the relation is transitive:
`(x.compareTo(y) > 0 && y.compareTo(z) > 0)` implies
`x.compareTo(z) > 0`.

Finally, the implementor must ensure that `x.compareTo(y)==0` implies that `signum(x.compareTo(z))
== signum(y.compareTo(z))`, for all `z`.

<br />

##### API Note:

- It is strongly recommended, but *not* strictly required that `(x.compareTo(y)==0) == (x.equals(y))`. Generally speaking, any class that implements the `Comparable` interface and violates this condition should clearly indicate this fact. The recommended language is "Note: this class has a natural ordering that is inconsistent with equals."

| Parameters ||
|---|---|
| `o` | `T`: the object to be compared. <br /> |

| Returns ||
|---|---|
| `int` | a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/ClassCastException` | if the specified object's type prevents it from being compared to this object. |
| `https://developer.android.com/reference/java/lang/NullPointerException` | if the specified object is null |