Stay organized with collections
Save and categorize content based on your preferences.
Pressure
class Pressure : Comparable<Pressure!>
Represents a unit of pressure. Supported units: millimeters of Mercury (mmHg)
Summary
Public methods |
Int |
Compares this object with the specified object for order.
|
Boolean |
Indicates whether some other object is "equal to" this one.
|
static Pressure |
Creates a Pressure object with the specified value in millimeters of Mercury (mmHg).
|
Double |
Returns pressure in millimeters of mercury
|
Int |
Returns a hash code value for the object.
|
String |
|
Public methods
compareTo
fun compareTo(other: Pressure): Int
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.
Parameters |
o |
the object to be compared. |
other |
Pressure: the object to be compared. This value cannot be null . |
Return |
Int |
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. |
Exceptions |
java.lang.NullPointerException |
if the specified object is null |
java.lang.ClassCastException |
if the specified object's type prevents it from being compared to this object. |
equals
fun equals(other: Any?): Boolean
Indicates whether some other object is "equal to" this one.
Parameters |
obj |
the reference object with which to compare. |
object |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the object argument; false otherwise. |
fromMillimetersOfMercury
static fun fromMillimetersOfMercury(value: Double): Pressure
Creates a Pressure object with the specified value in millimeters of Mercury (mmHg).
Parameters |
value |
Double: value to be set as millimeters of Mercury. |
Return |
Pressure |
This value cannot be null . |
getInMillimetersOfMercury
fun getInMillimetersOfMercury(): Double
Returns pressure in millimeters of mercury
hashCode
fun hashCode(): Int
Returns a hash code value for the object.
Return |
Int |
a hash code value for this object. |
toString
fun toString(): String
Return |
String |
a string representation of the object. |
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,["# Pressure\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nPressure\n========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/health/connect/datatypes/units/Pressure \"View this page in Java\") \n\n```\nclass Pressure : Comparable\u003cPressure!\u003e\n```\n\n|---|------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.health.connect.datatypes.units.Pressure](#) |\n\nRepresents a unit of pressure. Supported units: millimeters of Mercury (mmHg)\n\nSummary\n-------\n\n| Public methods ||\n|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [compareTo](#compareTo(android.health.connect.datatypes.units.Pressure))`(`other:` `[Pressure](#)`)` Compares this object with the specified object for order. |\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Indicates whether some other object is \"equal to\" this one. |\n| static [Pressure](#) | [fromMillimetersOfMercury](#fromMillimetersOfMercury(kotlin.Double))`(`value:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`)` Creates a Pressure object with the specified value in millimeters of Mercury (mmHg). |\n| [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html) | [getInMillimetersOfMercury](#getInMillimetersOfMercury())`()` Returns pressure in millimeters of mercury |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` Returns a hash code value for the object. |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### compareTo\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun compareTo(other: Pressure): Int\n```\n\nCompares 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.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------|\n| `o` | the object to be compared. |\n| `other` | [Pressure](#): the object to be compared. This value cannot be `null`. |\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. |\n\n| Exceptions ||\n|----------------------------------|--------------------------------------------------------------------------------|\n| `java.lang.NullPointerException` | if the specified object is null |\n| `java.lang.ClassCastException` | if the specified object's type prevents it from being compared to this object. |\n\n### equals\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun equals(other: Any?): Boolean\n```\n\nIndicates whether some other object is \"equal to\" this one.\n\n| Parameters ||\n|----------|---------------------------------------------|\n| `obj` | the reference object with which to compare. |\n| `object` | the reference object with which to compare. |\n\n| Return ||\n|------------------------------------------------------------------------------------|------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if this object is the same as the object argument; `false` otherwise. |\n\n### fromMillimetersOfMercury\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic fun fromMillimetersOfMercury(value: Double): Pressure\n```\n\nCreates a Pressure object with the specified value in millimeters of Mercury (mmHg).\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------------------------------------|\n| `value` | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html): value to be set as millimeters of Mercury. |\n\n| Return ||\n|---------------|------------------------------|\n| [Pressure](#) | This value cannot be `null`. |\n\n### getInMillimetersOfMercury\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getInMillimetersOfMercury(): Double\n```\n\nReturns pressure in millimeters of mercury \n\n### hashCode\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hashCode(): Int\n```\n\nReturns a hash code value for the object.\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |\n\n### toString\n\nAdded in [API level 34](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]