Stay organized with collections
Save and categorize content based on your preferences.
Complexity
class Complexity
Enumeration for unit complexity. There are three levels:
- SINGLE: A single unit, optionally with a power and/or SI or binary prefix. Examples: hectare, square-kilometer, kilojoule, per-second, mebibyte.
- COMPOUND: A unit composed of the product of multiple single units. Examples: meter-per-second, kilowatt-hour, kilogram-meter-per-square-second.
- MIXED: A unit composed of the sum of multiple single units. Examples: foot-and-inch, hour-and-minute-and-second, degree-and-arcminute-and-arcsecond.
The complexity determines which operations are available. For example, you cannot set the power or prefix of a compound unit.
Summary
Enum values |
A compound unit, like meter-per-second.
|
A mixed unit, like hour-and-minute.
|
A single unit, like kilojoule.
|
Enum values
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MeasureUnit.Complexity\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nComplexity\n==========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/util/MeasureUnit.Complexity \"View this page in Java\") \n\n```\nclass Complexity\n```\n\n|---|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||\n| ↳ | [kotlin.Enum](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html)\\\u003c[android.icu.util.MeasureUnit.Complexity](#)\\\u003e ||\n| | ↳ | [android.icu.util.MeasureUnit.Complexity](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [MeasureUnit.Complexity.COMPOUND](#ENUM_VALUE:COMPOUND), [MeasureUnit.Complexity.MIXED](#ENUM_VALUE:MIXED), [MeasureUnit.Complexity.SINGLE](#ENUM_VALUE:SINGLE) |---------------------------------------------------------|-----------------------------------------| | [MeasureUnit.Complexity.COMPOUND](#ENUM_VALUE:COMPOUND) | A compound unit, like meter-per-second. | | [MeasureUnit.Complexity.MIXED](#ENUM_VALUE:MIXED) | A mixed unit, like hour-and-minute. | | [MeasureUnit.Complexity.SINGLE](#ENUM_VALUE:SINGLE) | A single unit, like kilojoule. | |\n\nEnumeration for unit complexity. There are three levels:\n\n- SINGLE: A single unit, optionally with a power and/or SI or binary prefix. Examples: hectare, square-kilometer, kilojoule, per-second, mebibyte.\n- COMPOUND: A unit composed of the product of multiple single units. Examples: meter-per-second, kilowatt-hour, kilogram-meter-per-square-second.\n- MIXED: A unit composed of the sum of multiple single units. Examples: foot-and-inch, hour-and-minute-and-second, degree-and-arcminute-and-arcsecond.\n\nThe complexity determines which operations are available. For example, you cannot set the power or prefix of a compound unit.\n\n\u003cbr /\u003e\n\nSummary\n-------\n\n| Enum values ||\n|--------------------------------------------------------------------------|---|\n| [COMPOUND](#ENUM_VALUE:COMPOUND) A compound unit, like meter-per-second. |\n| [MIXED](#ENUM_VALUE:MIXED) A mixed unit, like hour-and-minute. |\n| [SINGLE](#ENUM_VALUE:SINGLE) A single unit, like kilojoule. |\n\nEnum values\n-----------\n\n### COMPOUND\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val COMPOUND : MeasureUnit.Complexity\n```\n\nA compound unit, like meter-per-second. \n\n### MIXED\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val MIXED : MeasureUnit.Complexity\n```\n\nA mixed unit, like hour-and-minute. \n\n### SINGLE\n\nAdded in [API level 33](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nenum val SINGLE : MeasureUnit.Complexity\n```\n\nA single unit, like kilojoule."]]