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

# OrdinalBuilder

*** ** * ** ***

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

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

|---|---|---|---|
| [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.OrdinalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#)\> ||
|   |   | ↳ | [android.text.style.TtsSpan.OrdinalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#) |

A builder for TtsSpans of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String`.

## Summary

| Public constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#OrdinalBuilder()()` Creates a builder for a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String`. |
| `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#OrdinalBuilder(kotlin.String)(number: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` Creates a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String` and sets the `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String` argument. |
| `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#OrdinalBuilder(kotlin.Long)(number: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Creates a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String` and sets the `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String` argument. |

| Public methods ||
|---|---|
| open [TtsSpan.OrdinalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#)! | `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#setNumber(kotlin.String)(number: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` Sets the `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String` argument. |
| open [TtsSpan.OrdinalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#)! | `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#setNumber(kotlin.Long)(number: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)` Convenience method that converts the number to a String and sets it to the value for `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String`. |

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

## Public constructors

### OrdinalBuilder

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

```
OrdinalBuilder()
```

Creates a builder for a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String`.

### OrdinalBuilder

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

```
OrdinalBuilder(number: String!)
```

Creates a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String` and sets the `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)!: The number to synthesize. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#setNumber(kotlin.String)`

### OrdinalBuilder

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

```
OrdinalBuilder(number: Long)
```

Creates a TtsSpan of type `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_ORDINAL:kotlin.String` and sets the `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_NUMBER:kotlin.String` argument.

| Parameters ||
|---|---|
| `number` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The ordinal number to synthesize. |

**See Also**

- `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#setNumber(kotlin.Long)`

## Public methods

### setNumber

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

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

Sets the `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 ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#!` | 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.OrdinalBuilder!
```

Convenience method that converts the number to a String and sets it to the value for `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 ordinal number that will be synthesized. |

| Return ||
|---|---|
| `https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.OrdinalBuilder#!` | This instance. |