AccessibilityNodeInfoCompat.MathInfoCompat


public class AccessibilityNodeInfoCompat.MathInfoCompat extends AccessibilityNodeInfoCompat.StructuredDataInfoCompat


Compat class for AccessibilityNodeInfo.MathInfo, which is a class that holds information about a node that represents a mathematical expression.

See also
AccessibilityNodeInfo.MathInfo

Compatibility:

  • API <: 36.1: Class methods perform no-op behavior.

Summary

Constants

static final String

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

static final String

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

static final String

An element for creating fractions.

static final String

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

static final String
MATH_TAG_MATH = "math"

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

static final String
MATH_TAG_MULTISCRIPTS = "mmultiscripts"

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

static final String

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

static final String

An element for a numeric literal.

static final String

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

static final String
MATH_TAG_OVER = "mover"

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

static final String

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

static final String
MATH_TAG_ROOT = "mroot"

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

static final String
MATH_TAG_ROW = "mrow"

An element for grouping sub-expressions horizontally.

static final String

An element for a square root.

static final String

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

static final String
MATH_TAG_SUB = "msub"

An element that attaches a subscript to a base expression.

static final String
MATH_TAG_SUB_SUP = "msubsup"

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

static final String
MATH_TAG_SUP = "msup"

An element that attaches a superscript to a base expression.

static final String
MATH_TAG_TABLE = "mtable"

An element for creating tables or matrices.

static final String

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

static final String

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

static final String
MATH_TAG_TEXT = "mtext"

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

static final String
MATH_TAG_UNDER = "munder"

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

static final String
MATH_TAG_UNDER_OVER = "munderover"

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

Public constructors

MathInfoCompat(@Nullable MathInfo mathInfo)

Instantiates a new MathInfoCompat.

Instantiates a new MathInfoCompat.

Public methods

@Nullable String
getAttribute(@NonNull String attributeKey)

Gets the value of an attribute.

@Nullable String
void
putAttribute(@NonNull String attributeKey, @NonNull String value)

Adds an attribute.

void

Removes an attribute.

Constants

MATH_ATTRIBUTE_ARG

public static final String MATH_ATTRIBUTE_ARG = "arg"

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

MATH_ATTRIBUTE_INTENT

public static final String MATH_ATTRIBUTE_INTENT = "intent"

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.

MATH_TAG_FRACTION

public static final String MATH_TAG_FRACTION = "mfrac"

An element for creating fractions.

MATH_TAG_IDENTIFIER

public static final String MATH_TAG_IDENTIFIER = "mi"

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

MATH_TAG_MATH

public static final String MATH_TAG_MATH = "math"

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

MATH_TAG_MULTISCRIPTS

public static final String MATH_TAG_MULTISCRIPTS = "mmultiscripts"

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

MATH_TAG_NONE_SCRIPT

public static final String MATH_TAG_NONE_SCRIPT = "none"

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

MATH_TAG_NUMBER

public static final String MATH_TAG_NUMBER = "mn"

An element for a numeric literal.

MATH_TAG_OPERATOR

public static final String MATH_TAG_OPERATOR = "mo"

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

MATH_TAG_OVER

public static final String MATH_TAG_OVER = "mover"

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

MATH_TAG_PRESCRIPT_DELIMITER

public static final String MATH_TAG_PRESCRIPT_DELIMITER = "mprescripts"

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

MATH_TAG_ROOT

public static final String MATH_TAG_ROOT = "mroot"

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

MATH_TAG_ROW

public static final String MATH_TAG_ROW = "mrow"

An element for grouping sub-expressions horizontally.

MATH_TAG_SQUARE_ROOT

public static final String MATH_TAG_SQUARE_ROOT = "msqrt"

An element for a square root.

MATH_TAG_STRING_LITERAL

public static final String MATH_TAG_STRING_LITERAL = "ms"

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

MATH_TAG_SUB

public static final String MATH_TAG_SUB = "msub"

An element that attaches a subscript to a base expression.

MATH_TAG_SUB_SUP

public static final String MATH_TAG_SUB_SUP = "msubsup"

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

MATH_TAG_SUP

public static final String MATH_TAG_SUP = "msup"

An element that attaches a superscript to a base expression.

MATH_TAG_TABLE

public static final String MATH_TAG_TABLE = "mtable"

An element for creating tables or matrices.

MATH_TAG_TABLE_CELL

public static final String MATH_TAG_TABLE_CELL = "mtd"

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

MATH_TAG_TABLE_ROW

public static final String MATH_TAG_TABLE_ROW = "mtr"

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

MATH_TAG_TEXT

public static final String MATH_TAG_TEXT = "mtext"

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

MATH_TAG_UNDER

public static final String MATH_TAG_UNDER = "munder"

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

MATH_TAG_UNDER_OVER

public static final String MATH_TAG_UNDER_OVER = "munderover"

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

Public constructors

MathInfoCompat

public MathInfoCompat(@Nullable MathInfo mathInfo)

Instantiates a new MathInfoCompat.

Parameters
@Nullable MathInfo mathInfo

The underlying MathInfo to wrap.

MathInfoCompat

public MathInfoCompat(@NonNull String tag)

Instantiates a new MathInfoCompat.

Parameters
@NonNull String tag

The MathML tag for this node.

Public methods

getAttribute

public @Nullable String getAttribute(@NonNull String attributeKey)

Gets the value of an attribute.

getTag

public @Nullable String getTag()

putAttribute

public void putAttribute(@NonNull String attributeKey, @NonNull String value)

Adds an attribute.

removeAttribute

public void removeAttribute(@NonNull String attributeKey)

Removes an attribute.