com.lowagie.text.pdf

## Class BidiLine

- java.lang.Object
- - com.lowagie.text.pdf.BidiLine

    public class BidiLine
    extends java.lang.Object

Does all the line bidirectional processing with PdfChunk assembly.

Author:
  Paulo Soares (psoares@consiste.pt)

### Field Summary

Fields
`protected int` `arabicOptions`
`protected java.util.ArrayList` `chunks`
`protected int` `currentChar`
`protected PdfChunk[]` `detailChunks`
`protected int[]` `indexChars`
`protected int` `indexChunk`
`protected int` `indexChunkChar`
`protected static IntHashtable` `mirrorChars`
`protected byte[]` `orderLevels`
`protected int` `pieceSize`
`protected int` `runDirection`
`protected boolean` `shortStore`
`protected int` `storedCurrentChar`
`protected PdfChunk[]` `storedDetailChunks`
`protected int[]` `storedIndexChars`
`protected int` `storedIndexChunk`
`protected int` `storedIndexChunkChar`
`protected byte[]` `storedOrderLevels`
`protected int` `storedRunDirection`
`protected char[]` `storedText`
`protected int` `storedTotalTextLength`
`protected char[]` `text`
`protected int` `totalTextLength`

### Constructor Summary

Constructors
Constructor and Description
`BidiLine()` Creates new BidiLine
`BidiLine(BidiLine org)`

### Method Summary

Methods
`void` `addChunk(PdfChunk chunk)`
`void` `addChunks(java.util.ArrayList chunks)`
`void` `addPiece(char c, PdfChunk chunk)`
`void` `clearChunks()`
`java.util.ArrayList` `createArrayOfPdfChunks(int startIdx, int endIdx)`
`java.util.ArrayList` `createArrayOfPdfChunks(int startIdx, int endIdx, PdfChunk extraPdfChunk)`
`void` `doArabicShapping()`
`void` `flip(int start, int end)`
`boolean` `getParagraph(int runDirection)`
`float` `getWidth(int startIdx, int lastIdx)` Gets the width of a range of characters.
`int[]` `getWord(int startIdx, int idx)`
`boolean` `isEmpty()`
`static boolean` `isWS(char c)`
`void` `mirrorGlyphs()`
`PdfLine` `processLine(float leftX, float width, int alignment, int runDirection, int arabicOptions)`
`void` `reorder(int start, int end)`
`void` `restore()`
`void` `save()`
`int` `trimLeft(int startIdx, int endIdx)`
`int` `trimLeftEx(int startIdx, int endIdx)`
`int` `trimRight(int startIdx, int endIdx)`
`int` `trimRightEx(int startIdx, int endIdx)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Field Detail

#### runDirection

    protected int runDirection

#### pieceSize

    protected int pieceSize

#### text

    protected char[] text

#### detailChunks

    protected PdfChunk[] detailChunks

#### totalTextLength

    protected int totalTextLength

#### orderLevels

    protected byte[] orderLevels

#### indexChars

    protected int[] indexChars

#### chunks

    protected java.util.ArrayList chunks

#### indexChunk

    protected int indexChunk

#### indexChunkChar

    protected int indexChunkChar

#### currentChar

    protected int currentChar

#### storedRunDirection

    protected int storedRunDirection

#### storedText

    protected char[] storedText

#### storedDetailChunks

    protected PdfChunk[] storedDetailChunks

#### storedTotalTextLength

    protected int storedTotalTextLength

#### storedOrderLevels

    protected byte[] storedOrderLevels

#### storedIndexChars

    protected int[] storedIndexChars

#### storedIndexChunk

    protected int storedIndexChunk

#### storedIndexChunkChar

    protected int storedIndexChunkChar

#### storedCurrentChar

    protected int storedCurrentChar

#### shortStore

    protected boolean shortStore

#### mirrorChars

    protected static final IntHashtable mirrorChars

#### arabicOptions

    protected int arabicOptions

### Constructor Detail

#### BidiLine

    public BidiLine()

Creates new BidiLine

#### BidiLine

    public BidiLine(BidiLine org)

### Method Detail

#### isEmpty

    public boolean isEmpty()

#### clearChunks

    public void clearChunks()

#### getParagraph

    public boolean getParagraph(int runDirection)

#### addChunk

    public void addChunk(PdfChunk chunk)

#### addChunks

    public void addChunks(java.util.ArrayList chunks)

#### addPiece

    public void addPiece(char c,
                PdfChunk chunk)

#### save

    public void save()

#### restore

    public void restore()

#### mirrorGlyphs

    public void mirrorGlyphs()

#### doArabicShapping

    public void doArabicShapping()

#### processLine

    public PdfLine processLine(float leftX,
                      float width,
                      int alignment,
                      int runDirection,
                      int arabicOptions)

#### getWidth

    public float getWidth(int startIdx,
                 int lastIdx)

Gets the width of a range of characters.

Parameters:
  `startIdx` - the first index to calculate
  `lastIdx` - the last inclusive index to calculate
Returns:
  the sum of all widths

#### createArrayOfPdfChunks

    public java.util.ArrayList createArrayOfPdfChunks(int startIdx,
                                             int endIdx)

#### createArrayOfPdfChunks

    public java.util.ArrayList createArrayOfPdfChunks(int startIdx,
                                             int endIdx,
                                             PdfChunk extraPdfChunk)

#### getWord

    public int[] getWord(int startIdx,
                int idx)

#### trimRight

    public int trimRight(int startIdx,
                int endIdx)

#### trimLeft

    public int trimLeft(int startIdx,
               int endIdx)

#### trimRightEx

    public int trimRightEx(int startIdx,
                  int endIdx)

#### trimLeftEx

    public int trimLeftEx(int startIdx,
                 int endIdx)

#### reorder

    public void reorder(int start,
               int end)

#### flip

    public void flip(int start,
            int end)

#### isWS

    public static boolean isWS(char c)