本文整理汇总了Java中com.ibm.icu.lang.UCharacter.getPropertyName方法的典型用法代码示例。如果您正苦于以下问题:Java UCharacter.getPropertyName方法的具体用法?Java UCharacter.getPropertyName怎么用?Java UCharacter.getPropertyName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibm.icu.lang.UCharacter
的用法示例。
在下文中一共展示了UCharacter.getPropertyName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testAllICUBinaryProperties
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@SuppressWarnings("deprecation")
@Test
public void testAllICUBinaryProperties() {
for (int p = UProperty.BINARY_START; p < UProperty.BINARY_LIMIT; ++p) {
String shortName = UCharacter.getPropertyName(p, UProperty.NameChoice.SHORT);
if (shortName != null) {
// Does not throw.
isBinaryProperty(shortName);
}
String longName = UCharacter.getPropertyName(p, UProperty.NameChoice.LONG);
if (longName != null) {
// Does not throw.
isBinaryProperty(longName);
}
}
}
示例2: from
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
static Property from(String name) {
// Don't allow loose matching.
int property;
CHECK: try {
property = UCharacter.getPropertyEnum(name);
// Filter out synthetic names.
if (property == UProperty.GENERAL_CATEGORY_MASK) {
return null;
}
String shortName = UCharacter.getPropertyName(property, UProperty.NameChoice.SHORT);
if (shortName != null && shortName.equals(name)) {
break CHECK;
}
for (int i = 0;; ++i) {
String longName = UCharacter.getPropertyName(property, UProperty.NameChoice.LONG + i);
if (longName != null && longName.equals(name)) {
break CHECK;
}
}
} catch (IllegalArgumentException e) {
return null;
}
if (property >= UProperty.BINARY_START && property < BINARY_PROPERTY_LIMIT) {
return BinaryProperty.forId(property);
}
return EnumProperty.forId(property);
}
示例3: getName
import com.ibm.icu.lang.UCharacter; //导入方法依赖的package包/类
@Override
public String getName() {
return UCharacter.getPropertyName(propertyId, UProperty.NameChoice.LONG);
}