The getRunLevel() method of java.text.Bidi class used to provide the level for the nth run of this line of text if there is only one running state then It will provide base level for that state . Syntax:
public int getRunLevel(int run)
Parameters: This method accepts the index of the logical run for which the level of the run is to be retrieved. Return Value: This method provides the level for the particular run in the line of text. Below are the examples to illustrate the getRunLevel() method: Example 1:Â
Java
| // Java program to demonstrate// getRunLevel() method  importjava.text.*;importjava.util.*;importjava.io.*;  publicclassGFG {    publicstaticvoidmain(String[] argv)    {        // creating and initializing Bidi        Bidi bidi            = newBidi(                "Geeks For Geeks",                Bidi.DIRECTION_RIGHT_TO_LEFT);          // index for which level is needed        intindex = 0;          // getting the level of run        // using getRunLevel() method        intlevel = bidi.getRunLevel(index);          // display the result        System.out.println(            "level of first run is : "            + level);    }} | 
level of first run is : 2
Example 2:Â
Java
| // Java program to demonstrate// getRunLevel() method  importjava.text.*;importjava.util.*;importjava.io.*;  publicclassGFG {    publicstaticvoidmain(String[] argv)    {        // creating and initializing Bidi        Bidi bidi            = newBidi(                "Geeks For Geeks",                Bidi.DIRECTION_LEFT_TO_RIGHT);          // index for which level is needed        intindex = 0;          // getting the level of run        // using getRunLevel() method        intlevel = bidi.getRunLevel(index);          // display the result        System.out.println(            "level of first run is : "            + level);    }} | 
level of first run is : 0
Reference: https://docs.oracle.com/javase/9/docs/api/java/text/Bidi.html#getRunLevel-int-


 
                                    







