Stay organized with collections
Save and categorize content based on your preferences.
BidiClassifier
public
class
BidiClassifier
extends Object
Overrides default Bidi class values with custom ones.
The override mechanism requires to define a subclass of
BidiClassifier
which overrides the classifier
method to assign customized Bidi classes.
This may be useful for assigning Bidi classes to PUA characters, or
for special application needs. For instance, an application may want to
handle all spaces like L or R characters (according to the base direction)
when creating the visual ordering of logical lines which are part of a report
organized in columns: there should not be interaction between adjacent
cells.
To start using this customized
classifier with a Bidi object, it must be specified by calling the
Bidi.setCustomClassifier
method; after that, the method
classify
of the custom BidiClassifier
will be
called by the UBA implementation any time the class of a character is
to be determined.
Summary
Public methods |
int
|
classify(int c)
Gets customized Bidi class for the code point c .
|
Object
|
getContext()
Returns the current classifier context.
|
void
|
setContext(Object context)
Sets classifier context, which can be used either by a caller or
callee for various purposes.
|
Inherited methods |
From class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(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(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()
Causes the current thread to wait until it is awakened, typically
by being notified or interrupted.
|
|
Public constructors
BidiClassifier
public BidiClassifier (Object context)
Parameters |
context |
Object : Context for this classifier instance.
May be null. |
Public methods
classify
public int classify (int c)
Gets customized Bidi class for the code point c
.
Default implementation, to be overridden.
Parameters |
c |
int : Code point to be classified. |
Returns |
int |
An integer representing directional property / Bidi class for the
given code point c , or UCharacter.getIntPropertyMaxValue(UProperty.BIDI_CLASS)+1
to signify that there is no need to override the standard Bidi class for
the given code point. |
getContext
public Object getContext ()
Returns the current classifier context.
setContext
public void setContext (Object context)
Sets classifier context, which can be used either by a caller or
callee for various purposes.
Parameters |
context |
Object : Context for this classifier instance.
May be null. |
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,["# BidiClassifier\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Ctors](#pubctors) \\| [Methods](#pubmethods) \\| [Inherited Methods](#inhmethods) \n\nBidiClassifier\n==============\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/icu/text/BidiClassifier \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\n\n\nclass\nBidiClassifier\n`\n\n\n`\n\nextends `[Object](/reference/java/lang/Object)`\n\n\n`\n\n`\n\n\n`\n\n|---|---------------------------------|\n| [java.lang.Object](/reference/java/lang/Object) ||\n| ↳ | android.icu.text.BidiClassifier |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\nOverrides default Bidi class values with custom ones.\n\nThe override mechanism requires to define a subclass of\n`BidiClassifier` which overrides the `classifier`\nmethod to assign customized Bidi classes.\n\nThis may be useful for assigning Bidi classes to PUA characters, or\nfor special application needs. For instance, an application may want to\nhandle all spaces like L or R characters (according to the base direction)\nwhen creating the visual ordering of logical lines which are part of a report\norganized in columns: there should not be interaction between adjacent\ncells.\n\nTo start using this customized\nclassifier with a Bidi object, it must be specified by calling the\n`Bidi.setCustomClassifier` method; after that, the method\n`classify` of the custom `BidiClassifier` will be\ncalled by the UBA implementation any time the class of a character is\nto be determined.\n\n\u003cbr /\u003e\n\n**See also:**\n\n- [Bidi.setCustomClassifier(BidiClassifier)](/reference/android/icu/text/Bidi#setCustomClassifier(android.icu.text.BidiClassifier))\n\nSummary\n-------\n\n| ### Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| ` `[BidiClassifier](/reference/android/icu/text/BidiClassifier#BidiClassifier(java.lang.Object))`(`[Object](/reference/java/lang/Object)` context) ` |\n\n| ### Public methods ||\n|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` int` | ` `[classify](/reference/android/icu/text/BidiClassifier#classify(int))`(int c) ` Gets customized Bidi class for the code point `c`. |\n| ` `[Object](/reference/java/lang/Object) | ` `[getContext](/reference/android/icu/text/BidiClassifier#getContext())`() ` Returns the current classifier context. |\n| ` void` | ` `[setContext](/reference/android/icu/text/BidiClassifier#setContext(java.lang.Object))`(`[Object](/reference/java/lang/Object)` context) ` Sets classifier context, which can be used either by a caller or callee for various purposes. |\n\n| ### Inherited methods |\n|-----------------------|---|\n| From class ` `[java.lang.Object](/reference/java/lang/Object)` ` |---------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` `[Object](/reference/java/lang/Object) | ` `[clone](/reference/java/lang/Object#clone())`() ` Creates and returns a copy of this object. | | ` boolean` | ` `[equals](/reference/java/lang/Object#equals(java.lang.Object))`(`[Object](/reference/java/lang/Object)` obj) ` Indicates whether some other object is \"equal to\" this one. | | ` void` | ` `[finalize](/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](/reference/java/lang/Class)`\u003c?\u003e` | ` `[getClass](/reference/java/lang/Object#getClass())`() ` Returns the runtime class of this `Object`. | | ` int` | ` `[hashCode](/reference/java/lang/Object#hashCode())`() ` Returns a hash code value for the object. | | ` final void` | ` `[notify](/reference/java/lang/Object#notify())`() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` `[notifyAll](/reference/java/lang/Object#notifyAll())`() ` Wakes up all threads that are waiting on this object's monitor. | | ` `[String](/reference/java/lang/String) | ` `[toString](/reference/java/lang/Object#toString())`() ` Returns a string representation of the object. | | ` final void` | ` `[wait](/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](/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](/reference/java/lang/Object#wait())`() ` Causes the current thread to wait until it is awakened, typically by being *notified* or *interrupted*. | ||\n\nPublic constructors\n-------------------\n\n### BidiClassifier\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic BidiClassifier (Object context)\n```\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------|\n| `context` | `Object`: Context for this classifier instance. May be null. \u003cbr /\u003e |\n\nPublic methods\n--------------\n\n### classify\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic int classify (int c)\n```\n\nGets customized Bidi class for the code point `c`.\n\n\nDefault implementation, to be overridden.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----|--------------------------------------------|\n| `c` | `int`: Code point to be classified. \u003cbr /\u003e |\n\n| Returns ||\n|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `int` | An integer representing directional property / Bidi class for the given code point `c`, or UCharacter.getIntPropertyMaxValue(UProperty.BIDI_CLASS)+1 to signify that there is no need to override the standard Bidi class for the given code point. \u003cbr /\u003e |\n\n### getContext\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic Object getContext ()\n```\n\nReturns the current classifier context.\n\n\u003cbr /\u003e\n\n| Returns ||\n|---------------------------------------|--------|\n| [Object](/reference/java/lang/Object) | \u003cbr /\u003e |\n\n### setContext\n\nAdded in [API level 29](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic void setContext (Object context)\n```\n\nSets classifier context, which can be used either by a caller or\ncallee for various purposes.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------|\n| `context` | `Object`: Context for this classifier instance. May be null. \u003cbr /\u003e |"]]