> Documentation index: https://developer.android.com/reference/llms.txt

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

# MathInfo

*** ** * ** ***

```
class MathInfo : AccessibilityNodeInfo.StructuredDataInfo, Parcelable
```

|---|---|---|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||
| ↳ | [android.view.accessibility.AccessibilityNodeInfo.StructuredDataInfo](https://developer.android.com/reference/kotlin/android/view/accessibility/AccessibilityNodeInfo.StructuredDataInfo.md.txt) ||
|   | ↳ | [android.view.accessibility.AccessibilityNodeInfo.MathInfo](https://developer.android.com/reference/kotlin/android/view/accessibility/AccessibilityNodeInfo.MathInfo.md.txt#) |

A class that holds information about a node that represents a mathematical expression.

This class's structure is based on the concepts and tags defined in the [W3C MathML standard](https://www.w3.org/TR/mathml4/). An accessibility service can use this information to provide a richer experience for users interacting with mathematical content. For example, a screen reader could use the tag and attributes to correctly pronounce a fraction and allow the user to navigate between the numerator and the denominator.

To add math information to a node, create an instance of `MathInfo`, set its attributes using `putAttribute(String,String)`, and then call `setStructuredDataInfo(StructuredDataInfo)` on the `AccessibilityNodeInfo`.

## Summary

| Constants ||
|---|---|
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_ATTRIBUTE_ARG` An attribute used to associate a child element with one of the arguments in its parent's `MATH_ATTRIBUTE_INTENT` value. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_ATTRIBUTE_INTENT` An attribute that provides a semantic annotation for the element on which it is specified. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_FRACTION` An element for creating fractions. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_IDENTIFIER` An element for symbolic names or arbitrary text to be rendered as an identifier. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_MATH` The top-level root element that encapsulates a MathML expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_MULTISCRIPTS` An element for attaching any number of prescripts and postscripts to a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_NONE_SCRIPT` Represents an empty element, often used as a placeholder in elements like `mmultiscripts`. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_NUMBER` An element for a numeric literal. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_OPERATOR` An element for an operator, fence, separator, or accent. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_OVER` An element that attaches an accent or a limit over a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_PRESCRIPT_DELIMITER` An empty element used within `mmultiscripts` to separate postscripts from prescripts. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_ROOT` An element for radicals with an explicit index, such as a cube root. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_ROW` An element for grouping sub-expressions horizontally. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_SQUARE_ROOT` An element for a square root. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_STRING_LITERAL` An element for representing string literals, often for computer algebra systems. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_SUB` An element that attaches a subscript to a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_SUB_SUP` An element that attaches both a subscript and a superscript to a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_SUP` An element that attaches a superscript to a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_TABLE` An element for creating tables or matrices. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_TABLE_CELL` An element representing a single cell in a table or matrix. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_TABLE_ROW` An element representing a single row in a a table or matrix. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_TEXT` An element for arbitrary text to be rendered as itself, often used for commentary. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_UNDER` An element that attaches an accent or a limit under a base expression. |
| static [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `MATH_TAG_UNDER_OVER` An element that attaches scripts both under and over a base expression. |

Inherited constants From class `Parcelable` `Int` `CONTENTS_FILE_DESCRIPTOR`


Descriptor bit used with `describeContents()`: indicates that the Parcelable object's flattened representation includes a file descriptor.

<br />

`Int` `PARCELABLE_WRITE_RETURN_VALUE`


Flag for use with `writeToParcel`: the object being written is a return value, that is the result of a function such as "`Parcelable someFunction()`", "`void someFunction(out Parcelable)`", or "`void someFunction(inout Parcelable)`". Some implementations may want to release resources at this point.

<br />

| Public constructors ||
|---|---|
| `MathInfo(tag: String)` Creates a new MathInfo. |

| Public methods ||
|---|---|
| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | `describeContents()` Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)? | `getAttribute(attributeKey: String)` Gets the value of an attribute. |
| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | `getTag()` <br /> |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `putAttribute(attributeKey: String, value: String)` Adds an attribute. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `removeAttribute(attributeKey: String)` Removes an attribute. |
| [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | `writeToParcel(dest: Parcel, flags: Int)` Flatten this object in to a Parcel. |

Inherited functions From class `StructuredDataInfo` `Boolean` `equals(other: Any?)`


Indicates whether some other object is "equal to" this one.

The `equals` method implements an equivalence relation on non-null object references:

- It is *reflexive* : for any non-null reference value `x`, `x.equals(x)` should return `true`.
- It is *symmetric* : for any non-null reference values `x` and `y`, `x.equals(y)` should return `true` if and only if `y.equals(x)` returns `true`.
- It is *transitive* : for any non-null reference values `x`, `y`, and `z`, if `x.equals(y)` returns `true` and `y.equals(z)` returns `true`, then `x.equals(z)` should return `true`.
- It is *consistent* : for any non-null reference values `x` and `y`, multiple invocations of `x.equals(y)` consistently return `true` or consistently return `false`, provided no information used in `equals` comparisons on the objects is modified.
- For any non-null reference value `x`, `x.equals(null)` should return `false`.

An equivalence relation partitions the elements it operates on into *equivalence classes*; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

<br />

`MutableMap<String!, String!>` `getAttributes()`

<br />

`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 `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 `equals` 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 `equals` 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 />

`String` `toString()`


Returns a string representation of the object.

<br />

| Properties ||
|---|---|
| static [Parcelable.Creator](https://developer.android.com/reference/kotlin/android/os/Parcelable.Creator.md.txt#)\<[AccessibilityNodeInfo.MathInfo](https://developer.android.com/reference/kotlin/android/view/accessibility/AccessibilityNodeInfo.MathInfo.md.txt#)!\> | `CREATOR` <br /> |

## Constants

### MATH_ATTRIBUTE_ARG

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

```
static val MATH_ATTRIBUTE_ARG: String
```

An attribute used to associate a child element with one of the arguments in its parent's `MATH_ATTRIBUTE_INTENT` value.

The value of the `arg` attribute is a token that must match one of the argument names in the parent's `intent` value.

Use this attribute on a child node to explicitly link it to one of the argument placeholders in its parent's `intent` string. For example, if a parent node has `intent="gcd($1, $2)"`, the child node representing the first parameter of the function should have its `arg` attribute set to "1".

    Value: "arg"

### MATH_ATTRIBUTE_INTENT

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

```
static val MATH_ATTRIBUTE_INTENT: String
```

An attribute that provides a semantic annotation for the element on which it is specified.

The `intent` attribute's value is a string that can be parsed to determine the meaning of the element and its children. An `intent` value is a string consisting of a single token, or a function-like expression.

Use this attribute on a container node to disambiguate mathematical notation. For example, the expression `(a, b)` is ambiguous; it could be a point, an open interval, or the greatest common divisor. By setting `intent="open-interval($1, $2)"` on the parent node, you provide a precise, machine-readable meaning that accessibility services can use to provide a better experience. The `$1` and `$2` are placeholders for the arguments, which are identified on child nodes using the `MATH_ATTRIBUTE_ARG` attribute.

    Value: "intent"

### MATH_TAG_FRACTION

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

```
static val MATH_TAG_FRACTION: String
```

An element for creating fractions.

    Value: "mfrac"

### MATH_TAG_IDENTIFIER

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

```
static val MATH_TAG_IDENTIFIER: String
```

An element for symbolic names or arbitrary text to be rendered as an identifier.

    Value: "mi"

### MATH_TAG_MATH

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

```
static val MATH_TAG_MATH: String
```

The top-level root element that encapsulates a MathML expression.

    Value: "math"

### MATH_TAG_MULTISCRIPTS

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

```
static val MATH_TAG_MULTISCRIPTS: String
```

An element for attaching any number of prescripts and postscripts to a base expression.

    Value: "mmultiscripts"

### MATH_TAG_NONE_SCRIPT

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

```
static val MATH_TAG_NONE_SCRIPT: String
```

Represents an empty element, often used as a placeholder in elements like `mmultiscripts`.

    Value: "none"

### MATH_TAG_NUMBER

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

```
static val MATH_TAG_NUMBER: String
```

An element for a numeric literal.

    Value: "mn"

### MATH_TAG_OPERATOR

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

```
static val MATH_TAG_OPERATOR: String
```

An element for an operator, fence, separator, or accent.

    Value: "mo"

### MATH_TAG_OVER

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

```
static val MATH_TAG_OVER: String
```

An element that attaches an accent or a limit over a base expression.

    Value: "mover"

### MATH_TAG_PRESCRIPT_DELIMITER

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

```
static val MATH_TAG_PRESCRIPT_DELIMITER: String
```

An empty element used within `mmultiscripts` to separate postscripts from prescripts.

    Value: "mprescripts"

### MATH_TAG_ROOT

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

```
static val MATH_TAG_ROOT: String
```

An element for radicals with an explicit index, such as a cube root.

    Value: "mroot"

### MATH_TAG_ROW

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

```
static val MATH_TAG_ROW: String
```

An element for grouping sub-expressions horizontally.

    Value: "mrow"

### MATH_TAG_SQUARE_ROOT

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

```
static val MATH_TAG_SQUARE_ROOT: String
```

An element for a square root.

    Value: "msqrt"

### MATH_TAG_STRING_LITERAL

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

```
static val MATH_TAG_STRING_LITERAL: String
```

An element for representing string literals, often for computer algebra systems.

    Value: "ms"

### MATH_TAG_SUB

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

```
static val MATH_TAG_SUB: String
```

An element that attaches a subscript to a base expression.

    Value: "msub"

### MATH_TAG_SUB_SUP

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

```
static val MATH_TAG_SUB_SUP: String
```

An element that attaches both a subscript and a superscript to a base expression.

    Value: "msubsup"

### MATH_TAG_SUP

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

```
static val MATH_TAG_SUP: String
```

An element that attaches a superscript to a base expression.

    Value: "msup"

### MATH_TAG_TABLE

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

```
static val MATH_TAG_TABLE: String
```

An element for creating tables or matrices.

    Value: "mtable"

### MATH_TAG_TABLE_CELL

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

```
static val MATH_TAG_TABLE_CELL: String
```

An element representing a single cell in a table or matrix.

    Value: "mtd"

### MATH_TAG_TABLE_ROW

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

```
static val MATH_TAG_TABLE_ROW: String
```

An element representing a single row in a a table or matrix.

    Value: "mtr"

### MATH_TAG_TEXT

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

```
static val MATH_TAG_TEXT: String
```

An element for arbitrary text to be rendered as itself, often used for commentary.

    Value: "mtext"

### MATH_TAG_UNDER

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

```
static val MATH_TAG_UNDER: String
```

An element that attaches an accent or a limit under a base expression.

    Value: "munder"

### MATH_TAG_UNDER_OVER

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

```
static val MATH_TAG_UNDER_OVER: String
```

An element that attaches scripts both under and over a base expression.

    Value: "munderover"

## Public constructors

### MathInfo

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

```
MathInfo(tag: String)
```

Creates a new MathInfo.

| Parameters ||
|---|---|
| `tag` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): The MathML tag for this node. Value is one of the following: - `MATH_TAG_MATH` - `MATH_TAG_FRACTION` - `MATH_TAG_IDENTIFIER` - `MATH_TAG_MULTISCRIPTS` - `MATH_TAG_NONE_SCRIPT` - `MATH_TAG_NUMBER` - `MATH_TAG_OPERATOR` - `MATH_TAG_OVER` - `MATH_TAG_PRESCRIPT_DELIMITER` - `MATH_TAG_ROOT` - `MATH_TAG_ROW` - `MATH_TAG_SQUARE_ROOT` - `MATH_TAG_STRING_LITERAL` - `MATH_TAG_SUB` - `MATH_TAG_SUB_SUP` - `MATH_TAG_SUP` - `MATH_TAG_TABLE` - `MATH_TAG_TABLE_CELL` - `MATH_TAG_TABLE_ROW` - `MATH_TAG_TEXT` - `MATH_TAG_UNDER` - `MATH_TAG_UNDER_OVER` . This value cannot be `null`. |

## Public methods

### describeContents

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

```
fun describeContents(): Int
```

Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of `writeToParcel(Parcel,int)`, the return value of this method must include the `CONTENTS_FILE_DESCRIPTOR` bit.

| Return ||
|---|---|
| `Int` | a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either `0` or - `CONTENTS_FILE_DESCRIPTOR` |

### getAttribute

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

```
fun getAttribute(attributeKey: String): String?
```

Gets the value of an attribute.

| Parameters ||
|---|---|
| `attributeKey` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): Value is one of the following: - `MATH_ATTRIBUTE_INTENT` - `MATH_ATTRIBUTE_ARG` . This value cannot be `null`. |

| Return ||
|---|---|
| `String?` | This value may be `null`. |

### getTag

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

```
fun getTag(): String
```

| Return ||
|---|---|
| `String` | This value cannot be `null`. Value is one of the following: - `MATH_TAG_MATH` - `MATH_TAG_FRACTION` - `MATH_TAG_IDENTIFIER` - `MATH_TAG_MULTISCRIPTS` - `MATH_TAG_NONE_SCRIPT` - `MATH_TAG_NUMBER` - `MATH_TAG_OPERATOR` - `MATH_TAG_OVER` - `MATH_TAG_PRESCRIPT_DELIMITER` - `MATH_TAG_ROOT` - `MATH_TAG_ROW` - `MATH_TAG_SQUARE_ROOT` - `MATH_TAG_STRING_LITERAL` - `MATH_TAG_SUB` - `MATH_TAG_SUB_SUP` - `MATH_TAG_SUP` - `MATH_TAG_TABLE` - `MATH_TAG_TABLE_CELL` - `MATH_TAG_TABLE_ROW` - `MATH_TAG_TEXT` - `MATH_TAG_UNDER` - `MATH_TAG_UNDER_OVER` |

### putAttribute

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

```
fun putAttribute(
    attributeKey: String, 
    value: String
): Unit
```

Adds an attribute.

| Parameters ||
|---|---|
| `attributeKey` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): Value is one of the following: - `MATH_ATTRIBUTE_INTENT` - `MATH_ATTRIBUTE_ARG` . This value cannot be `null`. |
| `value` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): This value cannot be `null`. |

### removeAttribute

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

```
fun removeAttribute(attributeKey: String): Unit
```

Removes an attribute.

| Parameters ||
|---|---|
| `attributeKey` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html): Value is one of the following: - `MATH_ATTRIBUTE_INTENT` - `MATH_ATTRIBUTE_ARG` . This value cannot be `null`. |

### writeToParcel

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

```
fun writeToParcel(
    dest: Parcel, 
    flags: Int
): Unit
```

Flatten this object in to a Parcel.

| Parameters ||
|---|---|
| `dest` | [Parcel](https://developer.android.com/reference/kotlin/android/os/Parcel.md.txt#): This value cannot be `null`. |
| `flags` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): Additional flags about how the object should be written. May be 0 or `PARCELABLE_WRITE_RETURN_VALUE`. Value is either `0` or a combination of the following: - `PARCELABLE_WRITE_RETURN_VALUE` |

## Properties

### CREATOR

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

```
static val CREATOR: Parcelable.Creator<AccessibilityNodeInfo.MathInfo!>
```
**See Also**

- `android.os.Parcelable.Creator`