# TtsSpan.MeasureBuilder

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

# MeasureBuilder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/text/style/TtsSpan.MeasureBuilder "View this page in Java")  

```
open class MeasureBuilder : TtsSpan.SemioticClassBuilder<TtsSpan.MeasureBuilder!>
```

|---|---|---|----------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                               ||||
| ↳ | [android.text.style.TtsSpan.Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder)\<C\>                 |||
|   | ↳ | [android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder)\<[android.text.style.TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)\> ||
|   |   | ↳ | [android.text.style.TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#) |

A builder for TtsSpans of type[TYPE_MEASURE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_MEASURE:kotlin.String).

## Summary

|                                                                                                                                       Public constructors                                                                                                                                       ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#MeasureBuilder())`()` Creates a builder for a TtsSpan of type[TYPE_MEASURE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_MEASURE:kotlin.String). |

|                                                                                                                                                                                                                                                                                      Public methods                                                                                                                                                                                                                                                                                      ||
|--------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setDenominator](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setDenominator(kotlin.String))`(`denominator:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_DENOMINATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DENOMINATOR:kotlin.String)argument.                                                                     |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setDenominator](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setDenominator(kotlin.Long))`(`denominator:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Convenience method that converts the denominator to a String and set it to the value for[ARG_DENOMINATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DENOMINATOR:kotlin.String).    |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setFractionalPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setFractionalPart(kotlin.String))`(`fractionalPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)argument.                                                    |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setIntegerPart(kotlin.String))`(`integerPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)argument.                                                                   |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setIntegerPart(kotlin.Long))`(`integerPart:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Convenience method that converts the integer part to a String and set it to the value for[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String). |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setNumber](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setNumber(kotlin.String))`(`number:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_NUMBER](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String)argument.                                                                                              |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setNumber](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setNumber(kotlin.Long))`(`number:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Convenience method that converts the number to a String and set it to the value for[ARG_NUMBER](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String).                                  |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setNumerator](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setNumerator(kotlin.String))`(`numerator:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_NUMERATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMERATOR:kotlin.String)argument.                                                                               |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setNumerator](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setNumerator(kotlin.Long))`(`numerator:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Convenience method that converts the numerator to a String and set it to the value for[ARG_NUMERATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMERATOR:kotlin.String).                |
| open[TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | [setUnit](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#setUnit(kotlin.String))`(`unit:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_UNIT](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_UNIT:kotlin.String)argument.                                                                                                        |

| Inherited functions ||
|---|---|
| From class[Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder) |---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [TtsSpan](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan)! | [build](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#build())`()` <br /> Returns a TtsSpan built from the parameters set by the setter methods. <br />                                                                                                                                                                                                            | | C                                                                                     | [setIntArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setIntArgument(kotlin.String,%20kotlin.Int))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets an argument to an int value. <br />                   | | C                                                                                     | [setLongArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setLongArgument(kotlin.String,%20kotlin.Long))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Sets an argument to a long value. <br />              | | C                                                                                     | [setStringArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setStringArgument(kotlin.String,%20kotlin.String))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets an argument to a string value. <br /> | ||
| From class[SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder) |---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | C | [setAnimacy](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setAnimacy(kotlin.String))`(`animacy:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the animacy information for this instance. <br />                     | | C | [setCase](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setCase(kotlin.String))`(`grammaticalCase:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the grammatical case information for this instance. <br />          | | C | [setGender](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setGender(kotlin.String))`(`gender:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the gender information for this instance. <br />                         | | C | [setMultiplicity](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setMultiplicity(kotlin.String))`(`multiplicity:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the multiplicity information for this instance. <br /> | ||

## Public constructors

### MeasureBuilder

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

```
MeasureBuilder()
```

Creates a builder for a TtsSpan of type[TYPE_MEASURE](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_MEASURE:kotlin.String).

## Public methods

### setDenominator

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

```
open fun setDenominator(denominator: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_DENOMINATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DENOMINATOR:kotlin.String)argument.

|                                                                                          Parameters                                                                                           ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `denominator` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The denominator of a fraction; a non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setDenominator

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

```
open fun setDenominator(denominator: Long): TtsSpan.MeasureBuilder!
```

Convenience method that converts the denominator to a String and set it to the value for[ARG_DENOMINATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_DENOMINATOR:kotlin.String).

|                                                         Parameters                                                         ||
|---------------|-------------------------------------------------------------------------------------------------------------|
| `denominator` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The denominator of a fraction. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setFractionalPart

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

```
open fun setFractionalPart(fractionalPart: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)argument.

|                                                                                             Parameters                                                                                              ||
|------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `fractionalPart` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The fractional part of a decimal; a non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setIntegerPart

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

```
open fun setIntegerPart(integerPart: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)argument.

|                                                                                                Parameters                                                                                                 ||
|---------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `integerPart` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The integer part of a decimal or fraction; a non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setIntegerPart

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

```
open fun setIntegerPart(integerPart: Long): TtsSpan.MeasureBuilder!
```

Convenience method that converts the integer part to a String and set it to the value for[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String).

|                                                               Parameters                                                               ||
|---------------|-------------------------------------------------------------------------------------------------------------------------|
| `integerPart` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The integer part of a decimal or fraction. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setNumber

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

```
open fun setNumber(number: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_NUMBER](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String)argument.

|                                                                        Parameters                                                                         ||
|----------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `number` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:A non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setNumber

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

```
open fun setNumber(number: Long): TtsSpan.MeasureBuilder!
```

Convenience method that converts the number to a String and set it to the value for[ARG_NUMBER](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String).

|                                                    Parameters                                                     ||
|----------|---------------------------------------------------------------------------------------------------------|
| `number` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The amount of the measure. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setNumerator

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

```
open fun setNumerator(numerator: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_NUMERATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMERATOR:kotlin.String)argument.

|                                                                                        Parameters                                                                                         ||
|-------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `numerator` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The numerator of a fraction; a non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setNumerator

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

```
open fun setNumerator(numerator: Long): TtsSpan.MeasureBuilder!
```

Convenience method that converts the numerator to a String and set it to the value for[ARG_NUMERATOR](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMERATOR:kotlin.String).

|                                                       Parameters                                                       ||
|-------------|-----------------------------------------------------------------------------------------------------------|
| `numerator` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The numerator of a fraction. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

### setUnit

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

```
open fun setUnit(unit: String!): TtsSpan.MeasureBuilder!
```

Sets the[ARG_UNIT](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_UNIT:kotlin.String)argument.

|                                                     Parameters                                                     ||
|--------|------------------------------------------------------------------------------------------------------------|
| `unit` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:The unit of the measure. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MeasureBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MeasureBuilder#)! | This instance. |

**See Also**

- [android.text.style.TtsSpan#ARG_UNIT](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_UNIT:kotlin.String)