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

# BidiClassifier

*** ** * ** ***


`
public


class
BidiClassifier
`


`

extends https://developer.android.com/reference/java/lang/Object


`

`


`

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

<br />

*** ** * ** ***

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.

<br />

**See also:**

- `https://developer.android.com/reference/android/icu/text/Bidi#setCustomClassifier(android.icu.text.BidiClassifier)`

## Summary

| ### Public constructors ||
|---|---|
| ` https://developer.android.com/reference/android/icu/text/BidiClassifier#BidiClassifier(java.lang.Object)(https://developer.android.com/reference/java/lang/Object context) ` |

| ### Public methods ||
|---|---|
| ` int` | ` https://developer.android.com/reference/android/icu/text/BidiClassifier#classify(int)(int c) ` Gets customized Bidi class for the code point `c`. |
| ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/android/icu/text/BidiClassifier#getContext()() ` Returns the current classifier context. |
| ` void` | ` https://developer.android.com/reference/android/icu/text/BidiClassifier#setContext(java.lang.Object)(https://developer.android.com/reference/java/lang/Object context) ` Sets classifier context, which can be used either by a caller or callee for various purposes. |

| ### Inherited methods |
|---|---|
| From class ` https://developer.android.com/reference/java/lang/Object ` |---|---| | ` https://developer.android.com/reference/java/lang/Object` | ` https://developer.android.com/reference/java/lang/Object#clone()() ` Creates and returns a copy of this object. | | ` boolean` | ` https://developer.android.com/reference/java/lang/Object#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object obj) ` Indicates whether some other object is "equal to" this one. | | ` void` | ` 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 https://developer.android.com/reference/java/lang/Class<?>` | ` https://developer.android.com/reference/java/lang/Object#getClass()() ` Returns the runtime class of this `Object`. | | ` int` | ` https://developer.android.com/reference/java/lang/Object#hashCode()() ` Returns a hash code value for the object. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notify()() ` Wakes up a single thread that is waiting on this object's monitor. | | ` final void` | ` https://developer.android.com/reference/java/lang/Object#notifyAll()() ` Wakes up all threads that are waiting on this object's monitor. | | ` https://developer.android.com/reference/java/lang/String` | ` https://developer.android.com/reference/java/lang/Object#toString()() ` Returns a string representation of the object. | | ` final void` | ` 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` | ` 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` | ` 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 constructors

### BidiClassifier

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

```
public BidiClassifier (Object context)
```

<br />

<br />

| Parameters ||
|---|---|
| `context` | `Object`: Context for this classifier instance. May be null. <br /> |

## Public methods

### classify

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

```
public int classify (int c)
```

Gets customized Bidi class for the code point `c`.


Default implementation, to be overridden.

<br />

| Parameters ||
|---|---|
| `c` | `int`: Code point to be classified. <br /> |

| 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. <br /> |

### getContext

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

```
public Object getContext ()
```

Returns the current classifier context.

<br />

| Returns ||
|---|---|
| `https://developer.android.com/reference/java/lang/Object` | <br /> |

### setContext

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

```
public void setContext (Object context)
```

Sets classifier context, which can be used either by a caller or
callee for various purposes.

<br />

| Parameters ||
|---|---|
| `context` | `Object`: Context for this classifier instance. May be null. <br /> |