CLDR Ticket #8914(accepted tools)
Convert arbitrary strings or ints to use enums
Reported by: | mark | Owned by: | mark |
---|---|---|---|
Component: | util | Data Locale: | |
Phase: | rc | Review: | |
Weeks: | Data Xpath: | ||
Xref: |
Description
For faster, more robust access. Continuation of ticket:8068
To finish off ticket:8068, remove the APIs that take String organizations, and only leave the ones that take enums.
StandardCodes
platform_locale_levelString = new TreeMap<String, Map<String, String>>();
getLocaleCoverageOrganizationStrings,...
In CLDRFile, change the following (there's an existing enum we can use and expand).
getKey, getNameName, getNameType, getNameTypeName, typeNameToCode, getName,...
public static final int NO_NAME = -1, LANGUAGE_NAME = 0, SCRIPT_NAME = 1, TERRITORY_NAME = 2, VARIANT_NAME = 3,
CURRENCY_NAME = 4, CURRENCY_SYMBOL = 5,
TZ_EXEMPLAR = 6, TZ_START = TZ_EXEMPLAR,
TZ_GENERIC_LONG = 7, TZ_GENERIC_SHORT = 8,
TZ_STANDARD_LONG = 9, TZ_STANDARD_SHORT = 10,
TZ_DAYLIGHT_LONG = 11, TZ_DAYLIGHT_SHORT = 12,
TZ_LIMIT = 13,
KEY_NAME = 13,
KEY_TYPE_NAME = 14,
LIMIT_TYPES = 15;
Test generating element and attribute enums from the DTDData, and using those. (That's done in UnicodeTools for property name and enum values.) Would make access/creation for items like XPathParts much faster. If the change is sufficiently positive, may be worth the pain of transitioning.