本文整理汇总了Java中com.ibm.icu.lang.UScript.hasScript方法的典型用法代码示例。如果您正苦于以下问题:Java UScript.hasScript方法的具体用法?Java UScript.hasScript怎么用?Java UScript.hasScript使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.icu.lang.UScript
的用法示例。
在下文中一共展示了UScript.hasScript方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: has
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
@Override
public boolean has(int codePoint, int value) {
// See https://ssl.icu-project.org/trac/ticket/13462
switch (codePoint) {
case 0x3000:
case 0x3004:
case 0x3012:
case 0x3020:
case 0x3036:
return value == UScript.COMMON;
}
return UScript.hasScript(codePoint, value);
}
示例2: contains
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
@Override
public boolean contains(int c) {
return UScript.hasScript(c, script);
}
示例3: includesCharacter
import com.ibm.icu.lang.UScript; //导入方法依赖的package包/类
public boolean includesCharacter(int codePoint)
{
if (includedScripts == null && excludedScripts == null)
{
return true;
}
int codeScript = UScript.getScript(codePoint);
if (codeScript == UScript.UNKNOWN)
{
//include by default
return true;
}
if (codeScript == UScript.COMMON)
{
//COMMON is included unless explicitly excluded
return !excludedCommon;
}
if (codeScript == UScript.INHERITED)
{
//INHERITED is included unless explicitly excluded
return !excludedInherited;
}
if (includedScripts != null && includedScripts.contains(codeScript))
{
//the codepoint script is explicitly included
return true;
}
if (excludedScripts != null && excludedScripts.contains(codeScript))
{
//the codepoint script is explicitly excluded
return false;
}
if (includedScripts == null)
{
//not excluded
return true;
}
for (Integer script : includedScripts)
{
if (UScript.hasScript(codePoint, script))
{
//included as a secondary/extension script
return true;
}
}
//not included
return false;
}