public final class BidiOrder extends Object
Modifier and Type | Field and Description |
---|---|
static byte |
AL
Right-to-Left Arabic
|
static byte |
AN
Arabic Number
|
static byte |
B
Paragraph Separator
|
static byte |
BN
Boundary Neutral
|
static byte |
CS
Common Number Separator
|
static byte |
EN
European Number
|
static byte |
ES
European Number Separator
|
static byte |
ET
European Number Terminator
|
static byte |
L
Left-to-right
|
static byte |
LRE
Left-to-Right Embedding
|
static byte |
LRO
Left-to-Right Override
|
static byte |
NSM
Non-Spacing Mark
|
static byte |
ON
Other Neutrals
|
static byte |
PDF
Pop Directional Format
|
static byte |
R
Right-to-Left
|
static byte |
RLE
Right-to-Left Embedding
|
static byte |
RLO
Right-to-Left Override
|
static byte |
S
Segment Separator
|
static byte |
TYPE_MAX
Maximum bidi type value.
|
static byte |
TYPE_MIN
Minimum bidi type value.
|
static byte |
WS
Whitespace
|
Constructor and Description |
---|
BidiOrder(byte[] types)
Initialize using an array of direction types.
|
BidiOrder(byte[] types, byte paragraphEmbeddingLevel)
Initialize using an array of direction types and an externally supplied paragraph embedding level.
|
BidiOrder(char[] text, int offset, int length, byte paragraphEmbeddingLevel) |
Modifier and Type | Method and Description |
---|---|
byte |
getBaseLevel()
Return the base level of the paragraph.
|
static byte |
getDirection(char c) |
byte[] |
getLevels() |
byte[] |
getLevels(int[] linebreaks)
Return levels array breaking lines at offsets in linebreaks.
|
int[] |
getReordering(int[] linebreaks)
Return reordering array breaking lines at offsets in linebreaks.
|
public static final byte L
public static final byte LRE
public static final byte LRO
public static final byte R
public static final byte AL
public static final byte RLE
public static final byte RLO
public static final byte PDF
public static final byte EN
public static final byte ES
public static final byte ET
public static final byte AN
public static final byte CS
public static final byte NSM
public static final byte BN
public static final byte B
public static final byte S
public static final byte WS
public static final byte ON
public static final byte TYPE_MIN
public static final byte TYPE_MAX
public BidiOrder(byte[] types)
types
- the types array
public BidiOrder(byte[] types, byte paragraphEmbeddingLevel)
types
- the types array
paragraphEmbeddingLevel
- the externally supplied paragraph embedding level.
public BidiOrder(char[] text, int offset, int length, byte paragraphEmbeddingLevel)
public static final byte getDirection(char c)
public byte[] getLevels()
public byte[] getLevels(int[] linebreaks)
The returned levels array contains the resolved level for each bidi code passed to the constructor.
The linebreaks array must include at least one value. The values must be in strictly increasing order (no duplicates) between 1 and the length of the text, inclusive. The last value must be the length of the text.
linebreaks
- the offsets at which to break the paragraph
public int[] getReordering(int[] linebreaks)
The reordering array maps from a visual index to a logical index. Lines are concatenated from left to right. So for example, the fifth character from the left on the third line is
getReordering(linebreaks)[linebreaks[1] + 4](linebreaks[1] is the position after the last character of the second line, which is also the index of the first character on the third line, and adding four gets the fifth character from the left).
The linebreaks array must include at least one value. The values must be in strictly increasing order (no duplicates) between 1 and the length of the text, inclusive. The last value must be the length of the text.
linebreaks
- the offsets at which to break the paragraph.
public byte getBaseLevel()
Copyright © 1998–2024. All rights reserved.