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

# Attribute

```
open class Attribute : Serializable
```

|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||
| ↳ | [java.text.AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#) |

|---|
| Known Direct Subclasses [Format.Field](https://developer.android.com/reference/kotlin/java/text/Format.Field), [TextAttribute](https://developer.android.com/reference/kotlin/java/awt/font/TextAttribute.html#) |---|---| | [Format.Field](https://developer.android.com/reference/kotlin/java/text/Format.Field) | Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `Format.formatToCharacterIterator` and as field identifiers in `FieldPosition`. | | [TextAttribute](https://developer.android.com/reference/kotlin/java/awt/font/TextAttribute.html#) | The `TextAttribute` class defines attribute keys and attribute values used for text rendering. | |

|---|
| Known Indirect Subclasses [DateFormat.Field](https://developer.android.com/reference/kotlin/java/text/DateFormat.Field), [DateFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/DateFormat.Field.html#), [MessageFormat.Field](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field), [MessageFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field.html#), [NumberFormat.Field](https://developer.android.com/reference/kotlin/java/text/NumberFormat.Field), [NumberFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/NumberFormat.Field.html#) |---|---| | [DateFormat.Field](https://developer.android.com/reference/kotlin/java/text/DateFormat.Field) | Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `DateFormat.formatToCharacterIterator` and as field identifiers in `FieldPosition`. | | [DateFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/DateFormat.Field.html#) | The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that DateFormat. | | [MessageFormat.Field](https://developer.android.com/reference/kotlin/java/text/MessageFormat.Field) | Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `MessageFormat.formatToCharacterIterator`. | | [MessageFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/MessageFormat.Field.html#) | Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `MessageFormat.formatToCharacterIterator`. | | [NumberFormat.Field](https://developer.android.com/reference/kotlin/java/text/NumberFormat.Field) | Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `NumberFormat.formatToCharacterIterator` and as field identifiers in `FieldPosition`. | | [NumberFormat.Field](https://developer.android.com/reference/kotlin/android/icu/text/NumberFormat.Field.html#) | The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that NumberFormat. | |

Defines attribute keys that are used to identify text attributes. These keys are used in `AttributedCharacterIterator` and `AttributedString`.

## Summary

| Protected constructors ||
|---|---|
| `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#Attribute(kotlin.String)(name: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!)` Constructs an `Attribute` with the given name. |

| Public methods ||
|---|---|
| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#equals(kotlin.Any)(other: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?)` Compares two objects for equality. |
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#hashCode()()` Returns a hash code value for the object. |
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#toString()()` Returns a string representation of the object. |

| Protected methods ||
|---|---|
| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#getName()()` Returns the name of the attribute. |
| open [Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)! | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#readResolve()()` Resolves instances being deserialized to the predefined constants. |

| Properties ||
|---|---|
| static [AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#)! | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#INPUT_METHOD_SEGMENT:java.text.AttributedCharacterIterator.Attribute` Attribute key for input method segments. |
| static [AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#)! | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#LANGUAGE:java.text.AttributedCharacterIterator.Attribute` Attribute key for the language of some text. |
| static [AttributedCharacterIterator.Attribute](https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#)! | `https://developer.android.com/reference/kotlin/java/text/AttributedCharacterIterator.Attribute#READING:java.text.AttributedCharacterIterator.Attribute` Attribute key for the reading of some text. |

## Protected constructors

### Attribute

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

```
protected Attribute(name: String!)
```

Constructs an `Attribute` with the given name.

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

## Public methods

### equals

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

```
fun equals(other: Any?): Boolean
```

Compares two objects for equality. This version only returns true for `x.equals(y)` if `x` and `y` refer to the same object, and guarantees this for all subclasses.

| Parameters ||
|---|---|
| `obj` | the reference object with which to compare. |

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html` | `true` if this object is the same as the obj argument; `false` otherwise. |

### hashCode

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

```
fun hashCode(): Int
```

Returns a hash code value for the object. This version is identical to the one in `Object`, but is also final.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html` | a hash code value for this object. |

### toString

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

```
open fun toString(): String
```

Returns a string representation of the object. This version returns the concatenation of class name, `"("`, a name identifying the attribute and `")"`.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html` | a string representation of the object. |

## Protected methods

### getName

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

```
protected open fun getName(): String!
```

Returns the name of the attribute.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html!` | the name of `Attribute` |

### readResolve

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

```
protected open fun readResolve(): Any!
```

Resolves instances being deserialized to the predefined constants.

| Return ||
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html!` | the resolved `Attribute` object |

| Exceptions ||
|---|---|
| `java.io.InvalidObjectException` | if the object to resolve is not an instance of `Attribute` |

## Properties

### INPUT_METHOD_SEGMENT

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

```
static val INPUT_METHOD_SEGMENT: AttributedCharacterIterator.Attribute!
```

Attribute key for input method segments. Input methods often break up text into segments, which usually correspond to words.

Values are instances of `https://developer.android.com/reference/kotlin/java/text/Annotation` holding a `null` reference.
**See Also**

- `https://developer.android.com/reference/kotlin/java/text/Annotation`

### LANGUAGE

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

```
static val LANGUAGE: AttributedCharacterIterator.Attribute!
```

Attribute key for the language of some text.

Values are instances of `https://developer.android.com/reference/kotlin/java/util/Locale.html#`.
**See Also**

- `https://developer.android.com/reference/kotlin/java/util/Locale.html#`

### READING

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

```
static val READING: AttributedCharacterIterator.Attribute!
```

Attribute key for the reading of some text. In languages where the written form and the pronunciation of a word are only loosely related (such as Japanese), it is often necessary to store the reading (pronunciation) along with the written form.

Values are instances of `https://developer.android.com/reference/kotlin/java/text/Annotation` holding instances of `https://developer.android.com/reference/kotlin/java/lang/String.html#`.
**See Also**

- `https://developer.android.com/reference/kotlin/java/text/Annotation`
- `https://developer.android.com/reference/kotlin/java/lang/String.html#`