Added in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels) Summary: [Fields](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#lfields) \| [Protected Ctors](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#proctors) \| [Methods](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#pubmethods) \| [Protected Methods](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#promethods) \| [Inherited Methods](https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#inhmethods)

# AttributedCharacterIterator.Attribute


`
public
static


class
AttributedCharacterIterator.Attribute
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


implements

https://developer.android.com/reference/java/io/Serializable


`

|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | java.text.AttributedCharacterIterator.Attribute |

Known direct subclasses [Format.Field](https://developer.android.com/reference/java/text/Format.Field), [TextAttribute](https://developer.android.com/reference/java/awt/font/TextAttribute) [Format.Field](https://developer.android.com/reference/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/java/awt/font/TextAttribute) The `TextAttribute` class defines attribute keys and attribute values used for text rendering. Known indirect subclasses [DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field), [MessageFormat.Field](https://developer.android.com/reference/android/icu/text/MessageFormat.Field), [NumberFormat.Field](https://developer.android.com/reference/android/icu/text/NumberFormat.Field) [DateFormat.Field](https://developer.android.com/reference/android/icu/text/DateFormat.Field) The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that DateFormat.formatToCharacterIterator() method returns. [MessageFormat.Field](https://developer.android.com/reference/android/icu/text/MessageFormat.Field) Defines constants that are used as attribute keys in the `AttributedCharacterIterator` returned from `MessageFormat.formatToCharacterIterator`. [NumberFormat.Field](https://developer.android.com/reference/android/icu/text/NumberFormat.Field) The instances of this inner class are used as attribute keys and values in AttributedCharacterIterator that NumberFormat.formatToCharacterIterator() method returns.   

*** ** * ** ***

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

- `https://developer.android.com/reference/java/text/AttributedCharacterIterator`
- `https://developer.android.com/reference/java/text/AttributedString`

## Summary

| ### Fields ||
|---|---|
| ` public static final https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute` | `https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#INPUT_METHOD_SEGMENT` Attribute key for input method segments. |
| ` public static final https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute` | `https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#LANGUAGE` Attribute key for the language of some text. |
| ` public static final https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute` | `https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#READING` Attribute key for the reading of some text. |

| ### Protected constructors ||
|---|---|
| ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#Attribute(java.lang.String)(https://developer.android.com/reference/java/lang/String name) ` Constructs an `Attribute` with the given name. |

| ### Public methods ||
|---|---|
| ` final boolean` | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Compares two objects for equality. |
| ` final int` | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#hashCode()() ` Returns a hash code value for the object. |
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#toString()() ` Returns a string representation of the object. |

| ### Protected methods ||
|---|---|
| ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#getName()() ` Returns the name of the attribute. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/text/AttributedCharacterIterator.Attribute#readResolve()() ` Resolves instances being deserialized to the predefined constants. |

### Inherited methods

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*.


## Fields

### INPUT_METHOD_SEGMENT

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

```
public static final AttributedCharacterIterator.Attribute INPUT_METHOD_SEGMENT
```

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/java/text/Annotation` holding a `null` reference.

<br />

**See also:**

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

### LANGUAGE

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

```
public static final AttributedCharacterIterator.Attribute LANGUAGE
```

Attribute key for the language of some text.

Values are instances of `https://developer.android.com/reference/java/util/Locale`.

<br />

**See also:**

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

### READING

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

```
public static final AttributedCharacterIterator.Attribute READING
```

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/java/text/Annotation` holding instances of `https://developer.android.com/reference/java/lang/String`.

<br />

**See also:**

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

## Protected constructors

### Attribute

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

```
protected Attribute (String name)
```

Constructs an `Attribute` with the given name.

<br />

| Parameters ||
|---|---|
| `name` | `String`: the name of `Attribute` <br /> |

## Public methods

### equals

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

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

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.

<br />

| Parameters ||
|---|---|
| `obj` | `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 /> |

### hashCode

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

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

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

<br />

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

### toString

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

```
public String toString ()
```

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

<br />

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

## Protected methods

### getName

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

```
protected String getName ()
```

Returns the name of the attribute.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/String` | the name of `Attribute` <br /> |

### readResolve

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

```
protected Object readResolve ()
```

Resolves instances being deserialized to the predefined constants.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | the resolved `Attribute` object <br /> |

| Throws ||
|---|---|
| `https://developer.android.com/reference/java/io/InvalidObjectException` | if the object to resolve is not an instance of `Attribute` |