Added in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Methods](https://developer.android.com/reference/android/icu/text/MeasureFormat#pubmethods) \| [Inherited Methods](https://developer.android.com/reference/android/icu/text/MeasureFormat#inhmethods)

# MeasureFormat

*** ** * ** ***

` public class MeasureFormat `   
` ` ` ` ` extends https://developer.android.com/reference/android/icu/text/UFormat ` ` `

|---|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||||
| ↳ | [java.text.Format](https://developer.android.com/reference/java/text/Format) |||
|   | ↳ | [android.icu.text.UFormat](https://developer.android.com/reference/android/icu/text/UFormat) ||
|   |   | ↳ | android.icu.text.MeasureFormat |

<br />

*** ** * ** ***

A formatter for Measure objects.

**IMPORTANT:** New users are strongly encouraged to see if `https://developer.android.com/reference/android/icu/number/NumberFormatter` fits their use case. Although not deprecated, this class, MeasureFormat, is provided for backwards compatibility only, and has much more limited capabilities.

*** ** * ** ***

To format a Measure object, first create a formatter object using a MeasureFormat factory method. Then use that object's format or formatMeasures methods. Here is sample code:

```
MeasureFormat fmtFr = MeasureFormat.getInstance(ULocale.FRENCH, FormatWidth.SHORT);
Measure measure = new Measure(23, MeasureUnit.CELSIUS);

// Output: 23 °C
System.out.println(fmtFr.format(measure));

Measure measureF = new Measure(70, MeasureUnit.FAHRENHEIT);

// Output: 70 °F
System.out.println(fmtFr.format(measureF));

MeasureFormat fmtFrFull = MeasureFormat.getInstance(ULocale.FRENCH, FormatWidth.WIDE);
// Output: 70 pieds et 5,3 pouces
System.out.println(fmtFrFull.formatMeasures(new Measure(70, MeasureUnit.FOOT),
        new Measure(5.3, MeasureUnit.INCH)));

// Output: 1 pied et 1 pouce
System.out.println(
        fmtFrFull.formatMeasures(new Measure(1, MeasureUnit.FOOT), new Measure(1, MeasureUnit.INCH)));

MeasureFormat fmtFrNarrow = MeasureFormat.getInstance(ULocale.FRENCH, FormatWidth.NARROW);
// Output: 1\u2032 1\u2033
System.out.println(fmtFrNarrow.formatMeasures(new Measure(1, MeasureUnit.FOOT),
        new Measure(1, MeasureUnit.INCH)));

MeasureFormat fmtEn = MeasureFormat.getInstance(ULocale.ENGLISH, FormatWidth.WIDE);

// Output: 1 inch, 2 feet
fmtEn.formatMeasures(new Measure(1, MeasureUnit.INCH), new Measure(2, MeasureUnit.FOOT));
```

This class does not do conversions from one unit to another. It simply formats whatever units it is given

This class is immutable and thread-safe so long as its deprecated subclass, TimeUnitFormat, is never used. TimeUnitFormat is not thread-safe, and is mutable. Although this class has existing subclasses, this class does not support new sub-classes.
**See also:**

- `https://developer.android.com/reference/android/icu/text/UFormat`

## Summary

| ### Public methods ||
|---|---|
| ` final boolean` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object other) ` Two MeasureFormats, a and b, are equal if and only if they have the same formatWidth, locale, and equal number formats. |
| ` https://developer.android.com/reference/java/lang/StringBuffer` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#format(java.lang.Object,%20java.lang.StringBuffer,%20java.text.FieldPosition)(https://developer.android.com/reference/java/lang/Object obj, https://developer.android.com/reference/java/lang/StringBuffer toAppendTo, https://developer.android.com/reference/java/text/FieldPosition fpos) ` Able to format Collection\<? extends Measure\>, Measure\[\], and Measure by delegating to formatMeasures. |
| ` https://developer.android.com/reference/java/lang/StringBuilder` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#formatMeasurePerUnit(android.icu.util.Measure,%20android.icu.util.MeasureUnit,%20java.lang.StringBuilder,%20java.text.FieldPosition)(https://developer.android.com/reference/android/icu/util/Measure measure, https://developer.android.com/reference/android/icu/util/MeasureUnit perUnit, https://developer.android.com/reference/java/lang/StringBuilder appendTo, https://developer.android.com/reference/java/text/FieldPosition pos) ` Formats a single measure per unit. |
| ` https://developer.android.com/reference/java/lang/StringBuilder` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#formatMeasures(java.lang.StringBuilder,%20java.text.FieldPosition,%20android.icu.util.Measure[])(https://developer.android.com/reference/java/lang/StringBuilder appendTo, https://developer.android.com/reference/java/text/FieldPosition fpos, https://developer.android.com/reference/android/icu/util/Measure measures) ` Formats a sequence of measures. |
| ` final https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#formatMeasures(android.icu.util.Measure[])(https://developer.android.com/reference/android/icu/util/Measure measures) ` Format a sequence of measures. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getCurrencyFormat()() ` Return a formatter for CurrencyAmount objects in the default `FORMAT` locale. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getCurrencyFormat(java.util.Locale)(https://developer.android.com/reference/java/util/Locale locale) ` Return a formatter for CurrencyAmount objects in the given `https://developer.android.com/reference/java/util/Locale`. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getCurrencyFormat(android.icu.util.ULocale)(https://developer.android.com/reference/android/icu/util/ULocale locale) ` Return a formatter for CurrencyAmount objects in the given locale. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getInstance(java.util.Locale,%20android.icu.text.MeasureFormat.FormatWidth,%20android.icu.text.NumberFormat)(https://developer.android.com/reference/java/util/Locale locale, https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth formatWidth, https://developer.android.com/reference/android/icu/text/NumberFormat format) ` Create a format from the `https://developer.android.com/reference/java/util/Locale`, formatWidth, and format. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getInstance(java.util.Locale,%20android.icu.text.MeasureFormat.FormatWidth)(https://developer.android.com/reference/java/util/Locale locale, https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth formatWidth) ` Create a format from the `https://developer.android.com/reference/java/util/Locale` and formatWidth. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getInstance(android.icu.util.ULocale,%20android.icu.text.MeasureFormat.FormatWidth)(https://developer.android.com/reference/android/icu/util/ULocale locale, https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth formatWidth) ` Create a format from the locale, formatWidth, and format. |
| ` static https://developer.android.com/reference/android/icu/text/MeasureFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getInstance(android.icu.util.ULocale,%20android.icu.text.MeasureFormat.FormatWidth,%20android.icu.text.NumberFormat)(https://developer.android.com/reference/android/icu/util/ULocale locale, https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth formatWidth, https://developer.android.com/reference/android/icu/text/NumberFormat format) ` Create a format from the locale, formatWidth, and format. |
| ` final https://developer.android.com/reference/android/icu/util/ULocale` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getLocale()() ` Get the locale of this instance. |
| ` https://developer.android.com/reference/android/icu/text/NumberFormat` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getNumberFormat()() ` Get a copy of the number format. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getUnitDisplayName(android.icu.util.MeasureUnit)(https://developer.android.com/reference/android/icu/util/MeasureUnit unit) ` Gets the display name of the specified `https://developer.android.com/reference/android/icu/util/MeasureUnit` corresponding to the current locale and format width. |
| ` https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#getWidth()() ` Get the format width this instance is using. |
| ` final int` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/android/icu/util/Measure` | ` https://developer.android.com/reference/android/icu/text/MeasureFormat#parseObject(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String source, https://developer.android.com/reference/java/text/ParsePosition pos) ` Parses text from a string to produce a `Measure`. |

### Inherited methods

From class ` https://developer.android.com/reference/java/text/Format ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/text/Format#clone()() `

Creates and returns a copy of this object.
` final https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/text/Format#format(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Formats an object to produce a string.
` abstract https://developer.android.com/reference/java/lang/StringBuffer` ` https://developer.android.com/reference/java/text/Format#format(java.lang.Object,%20java.lang.StringBuffer,%20java.text.FieldPosition)(https://developer.android.com/reference/java/lang/Object obj, https://developer.android.com/reference/java/lang/StringBuffer toAppendTo, https://developer.android.com/reference/java/text/FieldPosition pos) `

Formats an object and appends the resulting text to a given string buffer.
` https://developer.android.com/reference/java/text/AttributedCharacterIterator` ` https://developer.android.com/reference/java/text/Format#formatToCharacterIterator(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Formats an Object producing an `AttributedCharacterIterator`.
` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/text/Format#parseObject(java.lang.String)(https://developer.android.com/reference/java/lang/String source) `

Parses text from the beginning of the given string to produce an object.
` abstract https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/text/Format#parseObject(java.lang.String,%20java.text.ParsePosition)(https://developer.android.com/reference/java/lang/String source, https://developer.android.com/reference/java/text/ParsePosition pos) `

Parses text from a string to produce an object.
From class ` https://developer.android.com/reference/java/lang/Object ` ` https://developer.android.com/reference/java/lang/Object` ` https://developer.android.com/reference/java/lang/Object#clone()() `

Creates and returns a copy of this object.
` boolean` ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) `

Indicates whether some other object is "equal to" this one.
` void` ` https://developer.android.com/reference/java/lang/Object#finalize()() `

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.
` final https://developer.android.com/reference/java/lang/Class<?>` ` https://developer.android.com/reference/java/lang/Object#getClass()() `

Returns the runtime class of this `Object`.
` int` ` https://developer.android.com/reference/java/lang/Object#hashCode()() `

Returns a hash code value for the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#notify()() `

Wakes up a single thread that is waiting on this object's monitor.
` final void` ` https://developer.android.com/reference/java/lang/Object#notifyAll()() `

Wakes up all threads that are waiting on this object's monitor.
` https://developer.android.com/reference/java/lang/String` ` https://developer.android.com/reference/java/lang/Object#toString()() `

Returns a string representation of the object.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long,%20int)(long timeoutMillis, int nanos) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait(long)(long timeoutMillis) `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*, or until a certain amount of real time has elapsed.
` final void` ` https://developer.android.com/reference/java/lang/Object#wait()() `

Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*.

## Public methods

### equals

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

```
public final boolean equals (Object other)
```

Two MeasureFormats, a and b, are equal if and only if they have the same formatWidth, locale, and equal number formats.

<br />

| Parameters ||
|---|---|
| `other` | `Object`: the reference object with which to compare. <br /> |

| Returns ||
|---|---|
| `boolean` | `true` if this object is the same as the obj argument; `false` otherwise. <br /> |

### format

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

```
public StringBuffer format (Object obj, 
                StringBuffer toAppendTo, 
                FieldPosition fpos)
```

Able to format Collection\<? extends Measure\>, Measure\[\], and Measure by delegating to formatMeasures. If the pos argument identifies a NumberFormat field, then its indices are set to the beginning and end of the first such field encountered. MeasureFormat itself does not supply any fields. Calling a `formatMeasures` method is preferred over calling this method as they give better performance.

<br />

| Parameters ||
|---|---|
| `obj` | `Object`: must be a Collection\<? extends Measure\>, Measure\[\], or Measure object. <br /> |
| `toAppendTo` | `StringBuffer`: Formatted string appended here. <br /> |
| `fpos` | `FieldPosition`: Identifies a field in the formatted text. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuffer` | the string buffer passed in as `toAppendTo`, with formatted text appended <br /> |

**See also:**

- `https://developer.android.com/reference/java/text/Format#format(java.lang.Object,%20java.lang.StringBuffer,%20java.text.FieldPosition)`

### formatMeasurePerUnit

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

```
public StringBuilder formatMeasurePerUnit (Measure measure, 
                MeasureUnit perUnit, 
                StringBuilder appendTo, 
                FieldPosition pos)
```

Formats a single measure per unit. An example of such a formatted string is "3.5 meters per second."

<br />

| Parameters ||
|---|---|
| `measure` | `Measure`: the measure object. In above example, 3.5 meters. <br /> |
| `perUnit` | `MeasureUnit`: the per unit. In above example, it is MeasureUnit.SECOND <br /> |
| `appendTo` | `StringBuilder`: formatted string appended here. <br /> |
| `pos` | `FieldPosition`: The field position. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuilder` | appendTo. <br /> |

### formatMeasures

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

```
public StringBuilder formatMeasures (StringBuilder appendTo, 
                FieldPosition fpos, 
                Measure... measures)
```

Formats a sequence of measures. If the fieldPosition argument identifies a NumberFormat field, then its indices are set to the beginning and end of the first such field encountered. MeasureFormat itself does not supply any fields.

<br />

| Parameters ||
|---|---|
| `appendTo` | `StringBuilder`: the formatted string appended here. <br /> |
| `fpos` | `FieldPosition`: Identifies a field in the formatted text. <br /> |
| `measures` | `Measure`: the measures to format. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/StringBuilder` | appendTo. <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/text/MeasureFormat#formatMeasures(android.icu.util.Measure[])`

### formatMeasures

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

```
public final String formatMeasures (Measure... measures)
```

Format a sequence of measures. Uses the ListFormatter unit lists. So, for example, one could format \\u201c3 feet, 2 inches\\u201d. Zero values are formatted (eg, \\u201c3 feet, 0 inches\\u201d). It is the caller\\u2019s responsibility to have the appropriate values in appropriate order, and using the appropriate Number values. Typically the units should be in descending order, with all but the last Measure having integer values (eg, not \\u201c3.2 feet, 2 inches\\u201d).

<br />

| Parameters ||
|---|---|
| `measures` | `Measure`: a sequence of one or more measures. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the formatted string. <br /> |

### getCurrencyFormat

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

```
public static MeasureFormat getCurrencyFormat ()
```

Return a formatter for CurrencyAmount objects in the default `FORMAT` locale.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | a formatter object <br /> |

**See also:**

- `https://developer.android.com/reference/android/icu/util/ULocale.Category#FORMAT`

### getCurrencyFormat

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

```
public static MeasureFormat getCurrencyFormat (Locale locale)
```

Return a formatter for CurrencyAmount objects in the given `https://developer.android.com/reference/java/util/Locale`.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: desired `https://developer.android.com/reference/java/util/Locale` <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | a formatter object <br /> |

### getCurrencyFormat

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

```
public static MeasureFormat getCurrencyFormat (ULocale locale)
```

Return a formatter for CurrencyAmount objects in the given locale.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale`: desired locale <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | a formatter object <br /> |

### getInstance

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

```
public static MeasureFormat getInstance (Locale locale, 
                MeasureFormat.FormatWidth formatWidth, 
                NumberFormat format)
```

Create a format from the `https://developer.android.com/reference/java/util/Locale`, formatWidth, and format.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: the `https://developer.android.com/reference/java/util/Locale`. <br /> |
| `formatWidth` | `MeasureFormat.FormatWidth`: hints how long formatted strings should be. <br /> |
| `format` | `NumberFormat`: This is defensively copied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | The new MeasureFormat object. <br /> |

### getInstance

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

```
public static MeasureFormat getInstance (Locale locale, 
                MeasureFormat.FormatWidth formatWidth)
```

Create a format from the `https://developer.android.com/reference/java/util/Locale` and formatWidth.

<br />

| Parameters ||
|---|---|
| `locale` | `Locale`: the `https://developer.android.com/reference/java/util/Locale`. <br /> |
| `formatWidth` | `MeasureFormat.FormatWidth`: hints how long formatted strings should be. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | The new MeasureFormat object. <br /> |

### getInstance

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

```
public static MeasureFormat getInstance (ULocale locale, 
                MeasureFormat.FormatWidth formatWidth)
```

Create a format from the locale, formatWidth, and format.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale`: the locale. <br /> |
| `formatWidth` | `MeasureFormat.FormatWidth`: hints how long formatted strings should be. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | The new MeasureFormat object. <br /> |

### getInstance

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

```
public static MeasureFormat getInstance (ULocale locale, 
                MeasureFormat.FormatWidth formatWidth, 
                NumberFormat format)
```

Create a format from the locale, formatWidth, and format.

<br />

| Parameters ||
|---|---|
| `locale` | `ULocale`: the locale. <br /> |
| `formatWidth` | `MeasureFormat.FormatWidth`: hints how long formatted strings should be. <br /> |
| `format` | `NumberFormat`: This is defensively copied. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat` | The new MeasureFormat object. <br /> |

### getLocale

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

```
public final ULocale getLocale ()
```

Get the locale of this instance.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/ULocale` | <br /> |

### getNumberFormat

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

```
public NumberFormat getNumberFormat ()
```

Get a copy of the number format.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/NumberFormat` | <br /> |

### getUnitDisplayName

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

```
public String getUnitDisplayName (MeasureUnit unit)
```

Gets the display name of the specified `https://developer.android.com/reference/android/icu/util/MeasureUnit` corresponding to the current locale and format width.

<br />

| Parameters ||
|---|---|
| `unit` | `MeasureUnit`: The unit for which to get a display name. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | The display name in the locale and width specified in `https://developer.android.com/reference/android/icu/text/MeasureFormat#getInstance(android.icu.util.ULocale,%20android.icu.text.MeasureFormat.FormatWidth)`, or null if there is no display name available for the specified unit. <br /> |

### getWidth

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

```
public MeasureFormat.FormatWidth getWidth ()
```

Get the format width this instance is using.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/text/MeasureFormat.FormatWidth` | <br /> |

### hashCode

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

```
public final int hashCode ()
```

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by `https://developer.android.com/reference/java/util/HashMap`.

The general contract of `hashCode` is:

- Whenever it is invoked on the same object more than once during an execution of a Java application, the `hashCode` method must consistently return the same integer, provided no information used in `equals` comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
- If two objects are equal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce the same integer result.
- It is *not* required that if two objects are unequal according to the `https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)` method, then calling the `hashCode` method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.

<br />

<br />

| Returns ||
|---|---|
| `int` | a hash code value for this object. <br /> |

### parseObject

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

```
public Measure parseObject (String source, 
                ParsePosition pos)
```

Parses text from a string to produce a `Measure`.

<br />

| Parameters ||
|---|---|
| `source` | `String`: A `String`, part of which should be parsed. <br /> |
| `pos` | `ParsePosition`: A `ParsePosition` object with index and error index information as described above. <br /> |

| Returns ||
|---|---|
| `https://developer.android.com/reference/android/icu/util/Measure` | An `Object` parsed from the string. In case of error, returns null. <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/lang/UnsupportedOperationException` | Not supported. |

**See also:**

- `https://developer.android.com/reference/java/text/Format#parseObject(java.lang.String,%20java.text.ParsePosition)`