# BidiRun

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  
Summary:[Methods](https://developer.android.com/reference/android/icu/text/BidiRun#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/icu/text/BidiRun#inhmethods)  

# BidiRun

*** ** * ** ***

[Kotlin](https://developer.android.com/reference/kotlin/android/icu/text/BidiRun "View this page in Kotlin")\|Java

`
public


class
BidiRun
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object)`


``


`

|---|--------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object) ||
| ↳ | android.icu.text.BidiRun |

<br />

*** ** * ** ***

A BidiRun represents a sequence of characters at the same embedding level. The Bidi algorithm decomposes a piece of text into sequences of characters at the same embedding level, each such sequence is called a "run".

A BidiRun represents such a run by storing its essential properties, but does not duplicate the characters which form the run.

The "limit" of the run is the position just after the last character, i.e., one more than that position.

This class has no public constructor, and its members cannot be modified by users.  
**See also:**

- [Bidi](https://developer.android.com/reference/android/icu/text/Bidi)

## Summary

|                                                                                                                ### Public methods                                                                                                                ||
|-----------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` byte`                                                               | ` `[getDirection](https://developer.android.com/reference/android/icu/text/BidiRun#getDirection())`() ` Get direction of run                                              |
| ` byte`                                                               | ` `[getEmbeddingLevel](https://developer.android.com/reference/android/icu/text/BidiRun#getEmbeddingLevel())`() ` Get level of run                                        |
| ` int`                                                                | ` `[getLength](https://developer.android.com/reference/android/icu/text/BidiRun#getLength())`() ` Get length of run                                                       |
| ` int`                                                                | ` `[getLimit](https://developer.android.com/reference/android/icu/text/BidiRun#getLimit())`() ` Get position of one character after the end of the run in the source text |
| ` int`                                                                | ` `[getStart](https://developer.android.com/reference/android/icu/text/BidiRun#getStart())`() ` Get the first logical position of the run in the source text              |
| ` boolean`                                                            | ` `[isEvenRun](https://developer.android.com/reference/android/icu/text/BidiRun#isEvenRun())`() ` Check if run level is even                                              |
| ` boolean`                                                            | ` `[isOddRun](https://developer.android.com/reference/android/icu/text/BidiRun#isOddRun())`() ` Check if run level is odd                                                 |
| ` `[String](https://developer.android.com/reference/java/lang/String) | ` `[toString](https://developer.android.com/reference/android/icu/text/BidiRun#toString())`() ` String to display run                                                     |

| ### Inherited methods |
|-----------------------|---|
| From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object)` ` |--------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object)          | ` `[clone](https://developer.android.com/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object.                                                                                                                                                      | | ` boolean`                                                                     | ` `[equals](https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](https://developer.android.com/reference/java/lang/Object)` obj) ` Indicates whether some other object is "equal to" this one.                                           | | ` void`                                                                        | ` `[finalize](https://developer.android.com/reference/java/lang/Object#finalize())`() ` Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.                                                          | | ` final `[Class](https://developer.android.com/reference/java/lang/Class)`<?>` | ` `[getClass](https://developer.android.com/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this`Object`.                                                                                                                                                | | ` int`                                                                         | ` `[hashCode](https://developer.android.com/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object.                                                                                                                                                 | | ` final void`                                                                  | ` `[notify](https://developer.android.com/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor.                                                                                                                            | | ` final void`                                                                  | ` `[notifyAll](https://developer.android.com/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor.                                                                                                                         | | ` `[String](https://developer.android.com/reference/java/lang/String)          | ` `[toString](https://developer.android.com/reference/java/lang/Object#toString())`() ` Returns a string representation of the object.                                                                                                                                            | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long,%20int))`(long timeoutMillis, int nanos) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed. | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait(long))`(long timeoutMillis) ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*, or until a certain amount of real time has elapsed.                   | | ` final void`                                                                  | ` `[wait](https://developer.android.com/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being*notified* or*interrupted*.                                                                                             | ||

## Public methods

### getDirection

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public byte getDirection ()
```

Get direction of run

<br />

|    Returns     ||
|--------|--------|
| `byte` | <br /> |

### getEmbeddingLevel

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public byte getEmbeddingLevel ()
```

Get level of run

<br />

|    Returns     ||
|--------|--------|
| `byte` | <br /> |

### getLength

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getLength ()
```

Get length of run

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getLimit

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getLimit ()
```

Get position of one character after the end of the run in the source text

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### getStart

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public int getStart ()
```

Get the first logical position of the run in the source text

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### isEvenRun

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isEvenRun ()
```

Check if run level is even

<br />

|                                              Returns                                               ||
|-----------|-----------------------------------------------------------------------------------------|
| `boolean` | true if the embedding level of this run is even, i.e. it is a left-to-right run. <br /> |

### isOddRun

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public boolean isOddRun ()
```

Check if run level is odd

<br />

|                                              Returns                                              ||
|-----------|----------------------------------------------------------------------------------------|
| `boolean` | true if the embedding level of this run is odd, i.e. it is a right-to-left run. <br /> |

### toString

Added in[API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element#ApiLevels)  

```
public String toString ()
```

String to display run

<br />

|                                                      Returns                                                      ||
|--------------------------------------------------------------------|-----------------------------------------------|
| [String](https://developer.android.com/reference/java/lang/String) | a string representation of the object. <br /> |