Bidi createLineBidi() method in Java with Examples Last Updated : 27 Nov, 2019 Comments Improve Suggest changes Like Article Like Report The createLineBidi() method of java.text.Bidi class is used to create a new bidi object having same base direction and representing every property of current bidi within the range. Syntax: public Bidi createLineBidi(int lineStart, int lineLimit) Parameter: This method takes following argument as parameter lineStart: it is the start point of this new bidi lineLimit: it is the end point for this new bidi Return Value: This method return a new Bidi object Below are the examples to illustrate the createLineBidi() method: Example 1: Java // Java program to demonstrate // createLineBidi() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing Bidi // text with base direction Bidi bidi = new Bidi( "Geeks For Geeks", Bidi.DIRECTION_RIGHT_TO_LEFT); // creating and new bidi Object using the old one // using createLineBidi() method Bidi newbidi = bidi.createLineBidi(1, 6); // display the new bidi status System.out.println("New Bidi " + "\nLength : " + newbidi.getLength() + "\nnumber of levels : " + newbidi.getRunCount() + "\nBase Level : " + newbidi.getBaseLevel()); } } Output: New Bidi Length : 5 number of levels : 2 Base Level : 1 Example 2: Java // Java program to demonstrate // createLineBidi() method import java.text.*; import java.util.*; import java.io.*; public class GFG { public static void main(String[] argv) { // creating and initializing Bidi // text with base direction Bidi bidi = new Bidi("Tajmahal", Bidi.DIRECTION_RIGHT_TO_LEFT); // creating and new bidi Object using the old one // using createLineBidi() method Bidi newbidi = bidi.createLineBidi(3, 5); // display the new bidi status System.out.println("New Bidi " + "\nLength : " + newbidi.getLength() + "\nnumber of levels : " + newbidi.getRunCount() + "\nBase Level : " + newbidi.getBaseLevel()); } } Output: New Bidi Length : 2 number of levels : 1 Base Level : 2 Reference: https://docs.oracle.com/javase/9/docs/api/java/text/Bidi.html#createLineBidi-int-int- Comment More infoAdvertise with us Next Article Bidi createLineBidi() method in Java with Examples R rohitprasad3 Follow Improve Article Tags : Java Java-Functions Java-text package Java-Bidi Practice Tags : Java Similar Reads Bidi baseIsLeftToRight() method in Java with Examples The baseIsLeftToRight() method of java.text.Bidi class is used to check if this Bidi instance has left to right base direction or not. Syntax: public boolean baseIsLeftToRight() Parameter: This method accepts nothing as parameter. Return Value: This method return true if this bidi has left to right 2 min read Bidi getLength() method in Java with Examples The getLength() method of java.text.Bidi class is used to get the length of the text in this Bidi instance. Syntax: public int getLength() Parameter: This method accepts nothing as parameter. Return Value: This method provides the length of the bidi text as integer. Below are the examples to illustr 2 min read Bidi toString() method in Java with Examples The toString() method of java.text.Bidi class is used to display this Bidi instance in string representation. Syntax: public String toString() Parameter: This method accepts nothing as parameter. Return Value: This method display internal state of bidi in string format. Below are the examples to ill 2 min read List add() Method in Java with Examples The List add() method adds (appends) an element to a list. It can be used for both ArrayList and LinkedList. Example of List add() Method: Java // Java program to demonstrate // ArrayList usage import java.io.*; import java.util.ArrayList; import java.util.List; class GFG { public static void main ( 3 min read ConcurrentLinkedDeque offer() method in Java with Examples The java.util.concurrent.ConcurrentLinkedDeque.offer() method is an inbuilt method in Java which inserts the specified element, passed as a parameter, to the deque. Syntax: public boolean offer(E elem) Parameters: The method accepts a parameter elem which species the element to be inserted to the de 2 min read Like