當前位置: 首頁>>代碼示例>>Java>>正文


Java Bidi.createLineBidi方法代碼示例

本文整理匯總了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());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:22,代碼來源:BidiTest.java

示例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());
}
 
開發者ID:shannah,項目名稱:cn1,代碼行數:20,代碼來源:BidiTest.java

示例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));
}
 
開發者ID:lambdalab-mirror,項目名稱:jdk8u-jdk,代碼行數:16,代碼來源:BidiConformance.java

示例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);
}
 
開發者ID:keplersj,項目名稱:In-the-Box-Fork,代碼行數:7,代碼來源:OldBidiTest.java


注:本文中的java.text.Bidi.createLineBidi方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。