本文整理汇总了Java中com.ibm.icu.text.UTF16.getLeadSurrogate方法的典型用法代码示例。如果您正苦于以下问题:Java UTF16.getLeadSurrogate方法的具体用法?Java UTF16.getLeadSurrogate怎么用?Java UTF16.getLeadSurrogate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.icu.text.UTF16
的用法示例。
在下文中一共展示了UTF16.getLeadSurrogate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkNullNextTrailIndex
import com.ibm.icu.text.UTF16; //导入方法依赖的package包/类
/**
* Checks if we are beginning at the start of a initial block.
* If we are then the rest of the codepoints in this initial block
* has the same values.
* We increment m_nextCodepoint_ and relevant data members if so.
* This is used only in for the supplementary codepoints because
* the offset to the trail indexes could be 0.
* @return true if we are at the start of a initial block.
*/
private final boolean checkNullNextTrailIndex()
{
if (m_nextIndex_ <= 0) {
m_nextCodepoint_ += TRAIL_SURROGATE_COUNT_ - 1;
int nextLead = UTF16.getLeadSurrogate(m_nextCodepoint_);
int leadBlock =
m_trie_.m_index_[nextLead >> Trie.INDEX_STAGE_1_SHIFT_] <<
Trie.INDEX_STAGE_2_SHIFT_;
if (m_trie_.m_dataManipulate_ == null) {
throw new NullPointerException(
"The field DataManipulate in this Trie is null");
}
m_nextIndex_ = m_trie_.m_dataManipulate_.getFoldingOffset(
m_trie_.getValue(leadBlock +
(nextLead & Trie.INDEX_STAGE_3_MASK_)));
m_nextIndex_ --;
m_nextBlockIndex_ = DATA_BLOCK_LENGTH_;
return true;
}
return false;
}
示例2: mayHaveLccc
import com.ibm.icu.text.UTF16; //导入方法依赖的package包/类
static boolean mayHaveLccc(int c) {
// Handles all of Unicode 0..10FFFF.
// c can be negative, e.g., Collation.SENTINEL_CP.
// U+0300 is the first character with lccc!=0.
if(c < 0x300) { return false; }
if(c > 0xffff) { c = UTF16.getLeadSurrogate(c); }
int i;
return
(i = lcccIndex[c >> 5]) != 0 &&
(lcccBits[i] & (1 << (c & 0x1f))) != 0;
}