BidiFormatter.Builder

Added in 1.1.0

public final class BidiFormatter.Builder


A class for building a BidiFormatter with non-default options.

Summary

Public constructors

Constructor.

Builder(Locale locale)

Constructor.

Builder(boolean rtlContext)

Constructor.

Public methods

BidiFormatter
BidiFormatter.Builder

Specifies the default directionality estimation algorithm to be used by the BidiFormatter.

BidiFormatter.Builder
stereoReset(boolean stereoReset)

Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it.

Public constructors

Builder

Added in 1.1.0
public Builder()

Constructor.

Builder

Added in 1.1.0
public Builder(Locale locale)

Constructor.

Parameters
Locale locale

The context locale.

Builder

Added in 1.1.0
public Builder(boolean rtlContext)

Constructor.

Parameters
boolean rtlContext

Whether the context directionality is RTL.

Public methods

build

Added in 1.1.0
public BidiFormatter build()
Returns
BidiFormatter

A BidiFormatter with the specified options.

setTextDirectionHeuristic

Added in 1.1.0
public BidiFormatter.Builder setTextDirectionHeuristic(TextDirectionHeuristicCompat heuristic)

Specifies the default directionality estimation algorithm to be used by the BidiFormatter. By default, uses the first-strong heuristic.

Parameters
TextDirectionHeuristicCompat heuristic

the TextDirectionHeuristic to use.

Returns
BidiFormatter.Builder

the builder itself.

stereoReset

Added in 1.1.0
public BidiFormatter.Builder stereoReset(boolean stereoReset)

Specifies whether the BidiFormatter to be built should also "reset" directionality before a string being bidi-wrapped, not just after it. The default is true.