Package com.openhtmltopdf.bidi.support
Class ICUBidiSplitter
- java.lang.Object
-
- com.openhtmltopdf.bidi.support.ICUBidiSplitter
-
- All Implemented Interfaces:
BidiSplitter
public class ICUBidiSplitter extends java.lang.Object implements BidiSplitter
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ICUBidiSplitter.ICUBidiSplitterFactory
-
Field Summary
Fields Modifier and Type Field Description private com.ibm.icu.text.Bidi
bidi
-
Fields inherited from interface com.openhtmltopdf.bidi.BidiSplitter
LTR, NEUTRAL, RTL
-
-
Constructor Summary
Constructors Constructor Description ICUBidiSplitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
countTextRuns()
Count the number of runs, each of which contains text in one visual order only.byte
getBaseDirection(java.lang.String paragraph)
Get the base direction of a paragraph.BidiTextRun
getVisualRun(int runIndex)
void
setParagraph(java.lang.String paragraph, byte defaultDirection)
Sets the text which is to be split on visual ordering.
-
-
-
Method Detail
-
setParagraph
public void setParagraph(java.lang.String paragraph, byte defaultDirection)
Description copied from interface:BidiSplitter
Sets the text which is to be split on visual ordering.- Specified by:
setParagraph
in interfaceBidiSplitter
defaultDirection
- either LTR or RTL
-
countTextRuns
public int countTextRuns()
Description copied from interface:BidiSplitter
Count the number of runs, each of which contains text in one visual order only. Can only be called after setParagraph has run the BIDI algorithm.- Specified by:
countTextRuns
in interfaceBidiSplitter
-
getVisualRun
public BidiTextRun getVisualRun(int runIndex)
- Specified by:
getVisualRun
in interfaceBidiSplitter
- Parameters:
runIndex
- from zero to countTextRuns.- Returns:
- information about a visual run.
-
getBaseDirection
public byte getBaseDirection(java.lang.String paragraph)
Description copied from interface:BidiSplitter
Get the base direction of a paragraph. Defined as the first character that has strong directionality or neutral if they are all neutral characters.- Specified by:
getBaseDirection
in interfaceBidiSplitter
-
-