@Internal public interface CharIndexTranslator
Modifier and Type | Method and Description |
---|---|
int |
getByteIndex(int charPos)
Calculates the byte index of the given char index.
(计算给定字符索引的字节索引。)
|
int[][] |
getCharIndexRanges(int startBytePosInclusive, int endBytePosExclusive)
Finds character ranges that includes specified byte range.
(查找包含指定字节范围的字符范围。)
|
boolean |
isIndexInTable(int bytePos)
Check if index is in table
(检查索引是否在表中)
|
int |
lookIndexBackward(int bytePos)
Return last index <= bytePos that is in table
(返回表中的最后一个索引 <= bytePos)
|
int |
lookIndexForward(int bytePos)
Return first index >= bytePos that is in table
(返回表中的第一个索引 >= bytePos)
|
int getByteIndex(int charPos)
charPos
- The char position
(charPos - 字符位置)
int[][] getCharIndexRanges(int startBytePosInclusive, int endBytePosExclusive)
startBytePosInclusive
- start byte range
(startBytePosInclusive - 起始字节范围)
endBytePosExclusive
- end byte range
(endBytePosExclusive - 结束字节范围)
boolean isIndexInTable(int bytePos)
bytePos
-
(字节位置 -)
int lookIndexForward(int bytePos)
bytePos
-
(字节位置 -)
int lookIndexBackward(int bytePos)
bytePos
-
(字节位置 -)
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.