| Modifier and Type | Class and Description |
|---|---|
| public static enum | BidiTransform.Mirroring
|
| public static enum | BidiTransform.Order
|
| private static enum |
| Modifier and Type | Field and Description |
|---|---|
| private Bidi | |
| private int | |
| private int | |
| private String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private BidiTransform. | Returns: A validReorderingScheme object or nullFinds a valid |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| private static boolean | |
| private void | |
| private void | |
| private void | resolve(byte
Base embedding level level, int Reordering options options)Performs bidi resolution of text. |
| private void | resolveBaseDirection(byte[]
Byte array, where levels[0] is an input level levels[1] is
an output level. Resolved levels override these. levels)When the direction option is
|
| private void | |
| private void | shapeArabic(int
Digit shaping option that indicates whether the text
should be treated as logical or visual. digitsDir, int Letter shaping option that indicates whether the text
should be treated as logical or visual form (can mismatch the digit
option). lettersDir)Performs digit and letter shaping |
| private void | shapeArabic(int
Shaping options covering both letters and digits options)Performs digit and letter shaping |
| public String | Returns: The output string, which is the result of the layout transformation.An input character sequence that the Bidi layout
transformations will be performed on. text, byte A base embedding level of the input as defined in
inParaLevel, BidiTransform.
documentation for the paraLevel parameter.An order of the input, which can be one of the
inOrder, values.A base embedding level of the output as defined in
outParaLevel, BidiTransform.
documentation for the paraLevel parameter.An order of the output, which can be one of the
outOrder, values.Indicates whether or not to perform character
mirroring, and can accept one of the
doMirroring, values.Arabic digit and letter shaping options defined in
the shapingOptions) documentation.Note Direction indicator options are computed by the transformation engine based on the effective ordering schemes, so user-defined direction indicators will be ignored. Performs transformation of text from the bidi layout defined by the input ordering scheme to the bidi layout defined by the output ordering scheme, and applies character mirroring and Arabic shaping operations. |
| bidi | back to summary |
|---|---|
| private Bidi bidi | |
| reorderingOptions | back to summary |
|---|---|
| private int reorderingOptions | |
| shapingOptions | back to summary |
|---|---|
| private int shapingOptions | |
| text | back to summary |
|---|---|
| private String text | |
| BidiTransform | back to summary |
|---|---|
| public BidiTransform()
| |
| findMatchingScheme | back to summary |
|---|---|
| private BidiTransform. Finds a valid
| |
| IsLogical | back to summary |
|---|---|
| private static boolean IsLogical(BidiTransform. Is order logical? convenience method
| |
| IsLTR | back to summary |
|---|---|
| private static boolean IsLTR(byte level) Is level LTR? convenience method
| |
| IsRTL | back to summary |
|---|---|
| private static boolean IsRTL(byte level) Is level RTL? convenience method
| |
| IsVisual | back to summary |
|---|---|
| private static boolean IsVisual(BidiTransform. Is order visual? convenience method
| |
| mirror | back to summary |
|---|---|
| private void mirror() Performs character mirroring without reordering. When this method is
called, | |
| reorder | back to summary |
|---|---|
| private void reorder() Performs basic reordering of text (Logical LTR or RTL to Visual LTR). | |
| resolve | back to summary |
|---|---|
| private void resolve(byte level, int options) Performs bidi resolution of text.
| |
| resolveBaseDirection | back to summary |
|---|---|
| private void resolveBaseDirection(byte[] levels) When the direction option is
| |
| reverse | back to summary |
|---|---|
| private void reverse() Performs string reverse. | |
| shapeArabic | back to summary |
|---|---|
| private void shapeArabic(int digitsDir, int lettersDir) Performs digit and letter shaping
| |
| shapeArabic | back to summary |
|---|---|
| private void shapeArabic(int options) Performs digit and letter shaping
| |
| transform | back to summary |
|---|---|
| public String transform(CharSequence text, byte inParaLevel, BidiTransform. Performs transformation of text from the bidi layout defined by the input ordering scheme to the bidi layout defined by the output ordering scheme, and applies character mirroring and Arabic shaping operations.
In terms of
An "ordering scheme" encompasses the base direction and the order of text, and these characteristics must be defined by the caller for both input and output explicitly .
There are 36 possible combinations of {input, output} ordering schemes,
which are partially supported by
All combinations that involve the Visual RTL scheme are unsupported by
Example of usage of the transformation engine:
BidiTransform bidiTransform = new BidiTransform();
String in = "abc ۰123"; // "abc \\u06f0123"
// Run a transformation.
String out = bidiTransform.transform(in,
Bidi.LTR, Order.VISUAL,
Bidi.RTL, Order.LOGICAL,
Mirroring.OFF,
ArabicShaping.DIGITS_AN2EN | ArabicShaping.DIGIT_TYPE_AN_EXTENDED);
// Result: "0123 abc".
// Do something with out.
out = out.replace('0', '4');
// Result: "4123 abc".
// Run a reverse transformation.
String inNew = bidiTransform.transform(out,
Bidi.RTL, Order.LOGICAL,
Bidi.LTR, Order.VISUAL,
Mirroring.OFF,
ArabicShaping.DIGITS_EN2AN | ArabicShaping.DIGIT_TYPE_AN_EXTENDED);
// Result: "abc \\u06f4\\u06f1\\u06f2\\u06f3"
| |
Mirroring indicates whether or not characters with
the "mirrored" property in RTL runs should be replaced with their
mirror-image counterparts.
Bidi#DO_MIRRORING, Bidi#setReorderingOptions, Bidi#writeReordered, Bidi#writeReverse
| Modifier and Type | Field and Description |
|---|---|
| public static final BidiTransform. | OFF
Constant indicating that character mirroring should not be performed. |
| public static final BidiTransform. | ON
Constant indicating that character mirroring should be performed. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BidiTransform. | |
| public static BidiTransform. |
| OFF | back to summary |
|---|---|
| public static final BidiTransform. Constant indicating that character mirroring should not be performed.
| |
| ON | back to summary |
|---|---|
| public static final BidiTransform. Constant indicating that character mirroring should be performed.
This corresponds to calling
| |
| Mirroring | back to summary |
|---|---|
| private Mirroring() | |
| valueOf | back to summary |
|---|---|
| public static BidiTransform. | |
| values | back to summary |
|---|---|
| public static BidiTransform. | |
Order indicates the order of text.
This bidi transformation engine supports all possible combinations (4 in total) of input and output text order:
Bidi when the reordering mode is set to
Bidi#REORDER_DEFAULT. Visual RTL mode is not supported by
Bidi and is accomplished through reversing a visual
LTR string,Bidi with the reordering mode set to
Bidi#REORDER_INVERSE_LIKE_DIRECT. Visual RTL mode
is not not supported by Bidi and is accomplished
through reversing a visual LTR string,Bidi
implementation with the reordering mode set to
Bidi#REORDER_RUNS_ONLY; and if the input and output
base directions are identical, the transformation engine will only
handle character mirroring and Arabic shaping operations without
reordering,Bidi engine; it implies character mirroring,
Arabic shaping, and - if the input/output base directions mismatch -
string reverse operations.Bidi#setInverse, Bidi#setReorderingMode, Bidi#REORDER_DEFAULT, Bidi#REORDER_INVERSE_LIKE_DIRECT, Bidi#REORDER_RUNS_ONLY
| Modifier and Type | Field and Description |
|---|---|
| public static final BidiTransform. | LOGICAL
Constant indicating a logical order. |
| public static final BidiTransform. | VISUAL
Constant indicating a visual order. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static BidiTransform. | |
| public static BidiTransform. |
| LOGICAL | back to summary |
|---|---|
| public static final BidiTransform. Constant indicating a logical order.
| |
| VISUAL | back to summary |
|---|---|
| public static final BidiTransform. Constant indicating a visual order.
| |
| Order | back to summary |
|---|---|
| private Order() | |
| valueOf | back to summary |
|---|---|
| public static BidiTransform. | |
| values | back to summary |
|---|---|
| public static BidiTransform. | |
| Modifier and Type | Field and Description |
|---|---|
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. | |
| public static final BidiTransform. |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| pack-priv abstract void | doTransform(BidiTransform
Bidi transformation engine transform)Performs a series of bidi layout transformations unique for the current scheme. |
| pack-priv abstract boolean | Returns: true if it's a match, false
otherwiseBase level of the input text inLevel, BidiTransform.Order of the input text inOrder,Base level of the output text outLevel, BidiTransform.Order of the output text outOrderIndicates whether this scheme matches another one in terms of equality of base direction and ordering scheme. |
| public static BidiTransform. | |
| public static BidiTransform. |
| LOG_LTR_TO_LOG_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_LTR_TO_LOG_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_LTR_TO_VIS_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_LTR_TO_VIS_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_RTL_TO_LOG_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_RTL_TO_LOG_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_RTL_TO_VIS_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| LOG_RTL_TO_VIS_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_LTR_TO_LOG_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_LTR_TO_LOG_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_LTR_TO_VIS_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_LTR_TO_VIS_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_RTL_TO_LOG_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_RTL_TO_LOG_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_RTL_TO_VIS_LTR | back to summary |
|---|---|
| public static final BidiTransform. | |
| VIS_RTL_TO_VIS_RTL | back to summary |
|---|---|
| public static final BidiTransform. | |
| ReorderingScheme | back to summary |
|---|---|
| private ReorderingScheme() | |
| doTransform | back to summary |
|---|---|
| pack-priv abstract void doTransform(BidiTransform transform) Performs a series of bidi layout transformations unique for the current scheme.
| |
| matches | back to summary |
|---|---|
| pack-priv abstract boolean matches(byte inLevel, BidiTransform. Indicates whether this scheme matches another one in terms of equality of base direction and ordering scheme.
| |
| valueOf | back to summary |
|---|---|
| public static BidiTransform. | |
| values | back to summary |
|---|---|
| public static BidiTransform. | |