Stay organized with collections
Save and categorize content based on your preferences.
BidiRun
open class BidiRun
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.
Summary
Public methods |
open Byte |
Get direction of run
|
open Byte |
Get level of run
|
open Int |
Get length of run
|
open Int |
Get position of one character after the end of the run in the source text
|
open Int |
Get the first logical position of the run in the source text
|
open Boolean |
Check if run level is even
|
open Boolean |
Check if run level is odd
|
open String |
String to display run
|
Public methods
getDirection
open fun getDirection(): Byte
Get direction of run
getEmbeddingLevel
open fun getEmbeddingLevel(): Byte
Get level of run
getLength
open fun getLength(): Int
Get length of run
getLimit
open fun getLimit(): Int
Get position of one character after the end of the run in the source text
getStart
open fun getStart(): Int
Get the first logical position of the run in the source text
isEvenRun
open fun isEvenRun(): Boolean
Check if run level is even
Return |
Boolean |
true if the embedding level of this run is even, i.e. it is a left-to-right run. |
isOddRun
open fun isOddRun(): Boolean
Check if run level is odd
Return |
Boolean |
true if the embedding level of this run is odd, i.e. it is a right-to-left run. |
toString
open fun toString(): String
String to display run
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# BidiRun\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nBidiRun\n=======\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/text/BidiRun \"View this page in Java\") \n\n```\nopen class BidiRun\n```\n\n|---|-------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.icu.text.BidiRun](#) |\n\nA 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\".\n\nA BidiRun represents such a run by storing its essential properties, but does not duplicate the characters which form the run.\n\nThe \"limit\" of the run is the position just after the last character, i.e., one more than that position.\n\nThis class has no public constructor, and its members cannot be modified by users.\n\nSummary\n-------\n\n| Public methods ||\n|-----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------|\n| open [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html) | [getDirection](#getDirection())`()` Get direction of run |\n| open [Byte](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html) | [getEmbeddingLevel](#getEmbeddingLevel())`()` Get level of run |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getLength](#getLength())`()` Get length of run |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getLimit](#getLimit())`()` Get position of one character after the end of the run in the source text |\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getStart](#getStart())`()` Get the first logical position of the run in the source text |\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isEvenRun](#isEvenRun())`()` Check if run level is even |\n| open [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [isOddRun](#isOddRun())`()` Check if run level is odd |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` String to display run |\n\nPublic methods\n--------------\n\n### getDirection\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getDirection(): Byte\n```\n\nGet direction of run \n\n### getEmbeddingLevel\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getEmbeddingLevel(): Byte\n```\n\nGet level of run \n\n### getLength\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getLength(): Int\n```\n\nGet length of run \n\n### getLimit\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getLimit(): Int\n```\n\nGet position of one character after the end of the run in the source text \n\n### getStart\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getStart(): Int\n```\n\nGet the first logical position of the run in the source text \n\n### isEvenRun\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun isEvenRun(): Boolean\n```\n\nCheck if run level is even\n\n| Return ||\n|------------------------------------------------------------------------------------|----------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the embedding level of this run is even, i.e. it is a left-to-right run. |\n\n### isOddRun\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun isOddRun(): Boolean\n```\n\nCheck if run level is odd\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | true if the embedding level of this run is odd, i.e. it is a right-to-left run. |\n\n### toString\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun toString(): String\n```\n\nString to display run\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]