// where the first word is the BytesTrie offset.
return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias);
}
+
+ /**
+ * Returns a value enum given a property enum and one of its value names. Does not throw.
+ * @param property
+ * @param alias
+ * @return value enum, or UProperty.UNDEFINED if not defined for that property
+ * @internal
+ * @deprecated This API is ICU internal only.
+ */
+ @Deprecated
+ public int getPropertyValueEnumNoThrow(int property, CharSequence alias) {
+ try {
+ int valueMapIndex=findProperty(property);
+ if(valueMapIndex==0) {
+ return UProperty.UNDEFINED;
+ }
+ valueMapIndex=valueMaps[valueMapIndex+1];
+ if(valueMapIndex==0) {
+ return UProperty.UNDEFINED;
+ }
+ // valueMapIndex is the start of the property's valueMap,
+ // where the first word is the BytesTrie offset.
+ return getPropertyOrValueEnum(valueMaps[valueMapIndex], alias);
+ } catch (Exception e) {
+ return UProperty.UNDEFINED;
+ }
+ }
/**
* Compare two property names, returning <0, 0, or >0. The
*/
@Deprecated
public static int getPropertyValueEnumNoThrow(int property, CharSequence valueAlias) {
- int propEnum;
- try {
- propEnum = UPropertyAliases.INSTANCE.getPropertyValueEnum(property, valueAlias);
- } catch (Exception e) {
- propEnum = UProperty.UNDEFINED;
- }
- return propEnum;
+ return UPropertyAliases.INSTANCE.getPropertyValueEnumNoThrow(property, valueAlias);
}