Most visited

Recently visited

Added in API level 1

AndroidCharacter

public class AndroidCharacter
extends Object

java.lang.Object
   ↳ android.text.AndroidCharacter


AndroidCharacter公开了一些不容易从java.lang.Character访问的字符属性。

Summary

Constants

int EAST_ASIAN_WIDTH_AMBIGUOUS

int EAST_ASIAN_WIDTH_FULL_WIDTH

int EAST_ASIAN_WIDTH_HALF_WIDTH

int EAST_ASIAN_WIDTH_NARROW

int EAST_ASIAN_WIDTH_NEUTRAL

int EAST_ASIAN_WIDTH_WIDE

Public constructors

AndroidCharacter()

Public methods

static void getDirectionalities(char[] src, byte[] dest, int count)

填写 count的第一个 count字节,其 dest的第一个 count字符的 src

static int getEastAsianWidth(char input)

根据 Unicode TR#11计算字符的东亚宽度。

static void getEastAsianWidths(char[] src, int start, int count, byte[] dest)

填写第一 count字节 dest从东亚宽度 count的字符 src开始 start

static char getMirror(char ch)

返回指定字符的从右到左的镜像(如果没有,则返回原始字符)。

static boolean mirror(char[] text, int start, int count)

用字符的从右到左镜像(如果有)替换指定的 text切片,如果进行了任何替换,则返回true。

Inherited methods

From class java.lang.Object

Constants

EAST_ASIAN_WIDTH_AMBIGUOUS

Added in API level 8
int EAST_ASIAN_WIDTH_AMBIGUOUS

常数值:1(0x00000001)

EAST_ASIAN_WIDTH_FULL_WIDTH

Added in API level 8
int EAST_ASIAN_WIDTH_FULL_WIDTH

常量值:3(0x00000003)

EAST_ASIAN_WIDTH_HALF_WIDTH

Added in API level 8
int EAST_ASIAN_WIDTH_HALF_WIDTH

常量值:2(0x00000002)

EAST_ASIAN_WIDTH_NARROW

Added in API level 8
int EAST_ASIAN_WIDTH_NARROW

常量值:4(0x00000004)

EAST_ASIAN_WIDTH_NEUTRAL

Added in API level 8
int EAST_ASIAN_WIDTH_NEUTRAL

常量值:0(0x00000000)

EAST_ASIAN_WIDTH_WIDE

Added in API level 8
int EAST_ASIAN_WIDTH_WIDE

常量值:5(0x00000005)

Public constructors

AndroidCharacter

Added in API level 1
AndroidCharacter ()

Public methods

getDirectionalities

Added in API level 1
void getDirectionalities (char[] src, 
                byte[] dest, 
                int count)

填写第一count字节dest从第一与方向性count的字符src 这就像Character.getDirectionality(),除了它是批处理操作。

Parameters
src char
dest byte
count int

getEastAsianWidth

Added in API level 8
int getEastAsianWidth (char input)

根据Unicode TR#11计算字符的东亚宽度。 返回的将是一个EAST_ASIAN_WIDTH_NEUTRALEAST_ASIAN_WIDTH_AMBIGUOUSEAST_ASIAN_WIDTH_HALF_WIDTHEAST_ASIAN_WIDTH_FULL_WIDTHEAST_ASIAN_WIDTH_NARROW ,或EAST_ASIAN_WIDTH_WIDE

Parameters
input char: the character to measure
Returns
int the East Asian Width for input

getEastAsianWidths

Added in API level 8
void getEastAsianWidths (char[] src, 
                int start, 
                int count, 
                byte[] dest)

填写第一count字节dest从东亚宽度count的字符src开始start 东亚宽度根据Unicode TR#11计算。 在每个条目dest将是一个EAST_ASIAN_WIDTH_NEUTRALEAST_ASIAN_WIDTH_AMBIGUOUSEAST_ASIAN_WIDTH_HALF_WIDTHEAST_ASIAN_WIDTH_FULL_WIDTHEAST_ASIAN_WIDTH_NARROW ,或EAST_ASIAN_WIDTH_WIDE

Parameters
src char: character array of input to measure
start int: first character in array to measure
count int: maximum number of characters to measure
dest byte: byte array of results for each character in src

getMirror

Added in API level 1
char getMirror (char ch)

返回指定字符的从右到左的镜像(如果没有,则返回原始字符)。

Parameters
ch char
Returns
char

mirror

Added in API level 1
boolean mirror (char[] text, 
                int start, 
                int count)

用字符的从右到左镜像(如果有)替换指定的 text切片,如果进行了任何替换,则返回true。

Parameters
text char: array of characters to apply mirror operation
start int: first character in array to mirror
count int: maximum number of characters to mirror
Returns
boolean true if replacements were made

Hooray!