java.text
public final class Bidi extends Object
Since: 1.4
Field Summary | |
---|---|
static int | DIRECTION_DEFAULT_LEFT_TO_RIGHT
This indicates that a strongly directional character in the text should
set the initial direction, but if no such character is found, then the
initial direction will be left-to-right. |
static int | DIRECTION_DEFAULT_RIGHT_TO_LEFT
This indicates that a strongly directional character in the text should
set the initial direction, but if no such character is found, then the
initial direction will be right-to-left. |
static int | DIRECTION_LEFT_TO_RIGHT
This indicates that the initial direction should be left-to-right. |
static int | DIRECTION_RIGHT_TO_LEFT
This indicates that the initial direction should be right-to-left. |
Constructor Summary | |
---|---|
Bidi(AttributedCharacterIterator iter)
Create a new Bidi object given an attributed character iterator.
| |
Bidi(char[] text, int offset, byte[] embeddings, int embedOffset, int length, int flags)
Create a new Bidi object with the indicated text and, possibly, explicit
embedding settings.
| |
Bidi(String text, int flags)
Create a new Bidi object using the contents of the given String
as the text. |
Method Summary | |
---|---|
boolean | baseIsLeftToRight()
Return true if the paragraph base embedding is left-to-right,
false otherwise. |
Bidi | createLineBidi(int start, int end)
Create a new Bidi object for a single line of text, taken
from the text used when creating the current Bidi object. |
int | getBaseLevel()
Return the base embedding level of the paragraph. |
int | getLength()
Return the length of the paragraph, in characters. |
int | getLevelAt(int offset)
Return the level at the indicated character. |
int | getRunCount()
Return the number of runs in the result. |
int | getRunLevel(int which)
Return the level of the indicated run. |
int | getRunLimit(int which)
Return the index of the character just following the end
of the indicated run. |
int | getRunStart(int which)
Return the index of the first character in the indicated run. |
boolean | isLeftToRight()
Return true if the text is entirely left-to-right, and the
base embedding is also left-to-right. |
boolean | isMixed()
Return true if the text consists of mixed left-to-right and
right-to-left runs, or if the text consists of one kind of run
which differs from the base embedding direction. |
boolean | isRightToLeft()
Return true if the text is entirely right-to-left, and the
base embedding is also right-to-left. |
static void | reorderVisually(byte[] levels, int levelOffset, Object[] objs, int objOffset, int count)
Reorder objects according to the levels passed in. |
static boolean | requiresBidi(char[] text, int start, int end)
Returns false if all characters in the text between start and end
are all left-to-right text. |
String | toString()
Return a String describing the internal state of this object.
|
Parameters: iter the attributed character iterator to use
Parameters: text the text to use offset the offset of the first character of the text embeddings the explicit embeddings, or null if there are none embedOffset the offset of the first embedding value to use length the length of both the text and the embeddings flags a flag indicating the base embedding direction
Parameters: text the text to use flags a flag indicating the base embedding direction
Parameters: start the index of the first character of the line end the index of the final character of the line
Returns: a new Bidi object for the indicated line of text
Parameters: offset the character to examine
Returns: the level of that character
Parameters: which the run to examine
Returns: the level of that run
Parameters: which the run to examine
Returns: the index of the character after the final character of the run
Parameters: which the run to examine
Returns: the index of the first character of the run
Parameters: levels the levels associated with each object levelOffset the index of the first level to use objs the objects to reorder according to the levels objOffset the index of the first object to use count the number of objects (and levels) to manipulate
Character.getDirectionality(char)
on all characters
and makes sure all characters are either explicitly left-to-right
or neutral in directionality (character types L, EN, ES, ET, AN,
CS, S and WS).