Code example for Bidi

Methods: getRunCount, getRunLevel

0
        Bidi bidi = new Bidi("str", Bidi.DIRECTION_RIGHT_TO_LEFT);
        bidi.createLineBidi(2, 2);
    } 
 
    public void testGetRunLevelLInt() { 
        bd = new Bidi("text", Bidi.DIRECTION_LEFT_TO_RIGHT);
        try { 
            assertEquals(0, bd.getRunLevel(0));
            assertEquals(0, bd.getRunLevel(bd.getRunCount()));
        } catch (Exception e) {
            fail("Unexpected exception: " + e);
        } 
 
        bd = new Bidi("text", Bidi.DIRECTION_RIGHT_TO_LEFT);
        try { 
            assertEquals(2, bd.getRunLevel(0));
        } catch (Exception e) {
            fail("Unexpected exception: " + e);
        } 
 
        bd = new Bidi("text", Bidi.DIRECTION_DEFAULT_RIGHT_TO_LEFT);