public class BidiClassifier extends Object
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.
| 构造器 | 说明 |
|---|---|
BidiClassifier(Object context) |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
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.
|
public BidiClassifier(Object context)
context - Context for this classifier instance.
May be null.public void setContext(Object context)
context - Context for this classifier instance.
May be null.public Object getContext()
public int classify(int c)
c.
Default implementation, to be overridden.
c - Code point to be classified.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.