public class BidiPBAAlgorithm extends Object
Modifier and Type | Class and Description |
---|---|
static class |
BidiPBAAlgorithm.BracketPair |
Modifier and Type | Field and Description |
---|---|
static byte |
c |
byte[] |
codesIsolatedRun |
static byte |
n |
static byte |
o |
Constructor and Description |
---|
BidiPBAAlgorithm() |
Modifier and Type | Method and Description |
---|---|
String |
getPairPositionsString() |
void |
resolveBrackets(byte dirEmbed) |
void |
resolvePairedBrackets(int[] indexes,
byte[] codes,
byte[] pairTypes,
int[] pairValues,
byte sos,
byte level)
runAlgorithm - runs the paired bracket part of the UBA algorithm
|
void |
runAlgorithm(byte[] codes,
byte[] pairTypes,
int[] pairValues,
byte sos,
byte level)
Entry point for testing the BPA algorithm in isolation.
|
public static final byte n
public static final byte o
public static final byte c
public byte[] codesIsolatedRun
public String getPairPositionsString()
public void resolveBrackets(byte dirEmbed)
public void resolvePairedBrackets(int[] indexes, byte[] codes, byte[] pairTypes, int[] pairValues, byte sos, byte level)
indexes
- - indexes into the original stringcodes
- - bidi classes (directional codes) for each character in the
original stringpairTypes
- - array of paired bracket types for each character in the
original stringpairValues
- - array of unique integers identifying which pair of brackets
(or canonically equivalent set) a bracket character
belongs to. For example in the string "[Test(s)>"
the
characters "("
and ")"
would share one value and "["
and ">"
share another (assuming that "]"
and ">"
are canonically equivalent).
Characters that have pairType = n might always get pairValue = 0.
The actual values are no important as long as they are unique, so one way to assign them is to use the code position value for the closing element of a paired set for both opening and closing character - paying attention to first applying canonical decomposition.
sos
- - direction for soslevel
- - the embedding levelpublic void runAlgorithm(byte[] codes, byte[] pairTypes, int[] pairValues, byte sos, byte level)
codes
- - bidi classes (directional codes) for each characterpairTypes
- - array of paired bracket type values for each characterpairValues
- - array of unique integers identifying which bracket pair
see resolvePairedBrackets for details.sos
- - direction for soslevel
- - the embedding levelCopyright © 1998–2017 iText Group NV. All rights reserved.