Bidi getLevelAt Example

Bidi class getLevelAt example. This example shows you how to use getLevelAt method.


Bidi class getLevelAt example. public int getLevelAt(int offset) Return the resolved level of the character at offset. If offset is <0 or >= the length of the line, return the base direction level.

Here is the code
/*
 * @ # GetLevelAt.java
 * A class repersenting use to getLevelAt 
 * method of Bidi class in java.text package
 * version 13 June 2008
 * author Rose India 
 */

import java.text.*;

public class GetLevelAt {

    public static void main(String[] args) {

        String s = "Rose india.net";
        char[] ch = s.toCharArray();
        byte[] embeddings = {1234};
        int textStart = 0, embStart = 0, paragraphLength = 4;
        int flag = Bidi.DIRECTION_DEFAULT_LEFT_TO_RIGHT;
        Bidi bidi = new Bidi(ch, textStart, embeddings,
                embStart, paragraphLength, flag);

        System.out.println("LevelAt  " + bidi.getLevelAt(1));
    }
}

Output
LevelAt  2

Post Comment
Name:
E-mail:
Contact no :
Comments:
  Refresh Image
Verify Image:
 
 
Your Comment's
 
 
 

HOME | COPYRIGHT | CONTACT US