本文整理匯總了Java中java.text.Bidi.createLineBidi方法的典型用法代碼示例。如果您正苦於以下問題:Java Bidi.createLineBidi方法的具體用法?Java Bidi.createLineBidi怎麽用?Java Bidi.createLineBidi使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類java.text.Bidi
的用法示例。
在下文中一共展示了Bidi.createLineBidi方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testCreateLineBidi
import java.text.Bidi; //導入方法依賴的package包/類
public void testCreateLineBidi() {
bd = new Bidi("a\u05D0a\u05D0a\u05D0\"\u05D0a".toCharArray(), 0,
new byte[] { 0, 0, 0, -3, -3, 2, 2, 0, 3 }, 0, 9,
Bidi.DIRECTION_RIGHT_TO_LEFT);
Bidi line = bd.createLineBidi(2, 7);
assertFalse(line.baseIsLeftToRight());
assertEquals(1, line.getBaseLevel());
assertEquals(5, line.getLength());
assertEquals(2, line.getLevelAt(0));
assertEquals(3, line.getLevelAt(1));
assertEquals(3, line.getLevelAt(2));
assertEquals(3, line.getLevelAt(3));
assertEquals(2, line.getLevelAt(4));
assertEquals(1, line.getLevelAt(1000));
assertEquals(3, line.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 1, 2 }, { 1, 4, 3 },
{ 4, 5, 2 }, }, line);
assertFalse(line.isLeftToRight());
assertTrue(line.isMixed());
assertFalse(line.isRightToLeft());
}
示例2: testIncompatibleLineAlgorithm
import java.text.Bidi; //導入方法依賴的package包/類
public void testIncompatibleLineAlgorithm() {
// ICU treat a new line as in the same run, however RI does not
bd = new Bidi("aaaaa".toCharArray(), 0,
new byte[] { -2, -1, -3, -3, -2 }, 0, 5,
Bidi.DIRECTION_RIGHT_TO_LEFT);
Bidi line = bd.createLineBidi(1, 4);
assertFalse(line.baseIsLeftToRight());
assertEquals(1, line.getBaseLevel());
assertEquals(3, line.getLength());
assertEquals(1, line.getLevelAt(0));
assertEquals(1, line.getLevelAt(1));
assertEquals(1, line.getLevelAt(2));
assertEquals(1, line.getLevelAt(1000));
assertEquals(1, line.getRunCount());
assertRunArrayEquals(new int[][] { { 0, 3, 1 }, }, line);
assertFalse(line.isLeftToRight());
assertFalse(line.isMixed());
assertTrue(line.isRightToLeft());
}
示例3: testMethod_createLineBidi1
import java.text.Bidi; //導入方法依賴的package包/類
private void testMethod_createLineBidi1() {
System.out.println("*** Test createLineBidi() 1");
String str = " ABC 123. " + HebrewABC + " " + NKo123 + ". ABC 123";
int lineStart = str.indexOf('.') + 2;
int lineLimit = str.lastIndexOf('.') + 2;
Bidi bidi = new Bidi(str, FLAGS[0]);
Bidi lineBidi = bidi.createLineBidi(lineStart, lineLimit);
checkResult("getBaseLevel()",
bidi.getBaseLevel(), lineBidi.getBaseLevel());
checkResult("getLevelAt(5)",
bidi.getLevelAt(lineStart+5), lineBidi.getLevelAt(5));
}
示例4: testCreateLineBidi_AndroidFailure
import java.text.Bidi; //導入方法依賴的package包/類
public void testCreateLineBidi_AndroidFailure() {
// This is a difference between ICU4C and the RI. ICU4C insists that 'limit' is strictly
// greater than 'start'. We have to paper over this in our Java code.
Bidi bidi = new Bidi("str", Bidi.DIRECTION_RIGHT_TO_LEFT);
bidi.createLineBidi(2, 2);
}