]> granicus.if.org Git - icu/commitdiff
ICU-11092 Split out units data into a separate tree
authorJohn Emmons <emmo@us.ibm.com>
Thu, 11 Sep 2014 10:17:49 +0000 (10:17 +0000)
committerJohn Emmons <emmo@us.ibm.com>
Thu, 11 Sep 2014 10:17:49 +0000 (10:17 +0000)
X-SVN-Rev: 36459

icu4j/main/classes/core/src/com/ibm/icu/impl/ICUData.java
icu4j/main/classes/core/src/com/ibm/icu/text/MeasureFormat.java
icu4j/main/classes/core/src/com/ibm/icu/text/TimeUnitFormat.java
icu4j/main/shared/data/icudata.jar
icu4j/main/shared/data/icutzdata.jar

index b5fa3e14acf82f60d46b12a3d81a8104a6abf60d..ab43d1b32dce21e2e456a578bd03b74014414bc5 100644 (file)
@@ -73,6 +73,7 @@ public final class ICUData {
     public static final String ICU_CURR_BASE_NAME = ICU_BASE_NAME + "/curr";
     public static final String ICU_REGION_BASE_NAME = ICU_BASE_NAME + "/region";
     public static final String ICU_ZONE_BASE_NAME = ICU_BASE_NAME + "/zone";
+    public static final String ICU_UNIT_BASE_NAME = ICU_BASE_NAME + "/unit";
 
     /**
      * For testing (otherwise false): When reading an InputStream from a Class or ClassLoader
index b9a1cf006aea238e8d853cb5cd5514adf78cdb90..f4bd59dc8a7f1236413f5c6bfe8d3aed7a7a36cc 100644 (file)
@@ -29,6 +29,7 @@ import java.util.MissingResourceException;
 import java.util.concurrent.ConcurrentHashMap;
 
 import com.ibm.icu.impl.DontCareFieldPosition;
+import com.ibm.icu.impl.ICUData;
 import com.ibm.icu.impl.ICUResourceBundle;
 import com.ibm.icu.impl.SimpleCache;
 import com.ibm.icu.impl.SimplePatternFormatter;
@@ -704,7 +705,7 @@ public class MeasureFormat extends UFormat {
     private static NumericFormatters loadNumericFormatters(
             ULocale locale) {
         ICUResourceBundle r = (ICUResourceBundle)UResourceBundle.
-                getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
+                getBundleInstance(ICUData.ICU_BASE_NAME, locale);
         return new NumericFormatters(
                 loadNumericDurationFormat(r, "hm"),
                 loadNumericDurationFormat(r, "ms"),
@@ -719,7 +720,7 @@ public class MeasureFormat extends UFormat {
         QuantityFormatter.Builder builder = new QuantityFormatter.Builder();
         Map<MeasureUnit, EnumMap<FormatWidth, QuantityFormatter>> unitToStyleToCountToFormat
         = new HashMap<MeasureUnit, EnumMap<FormatWidth, QuantityFormatter>>();
-        ICUResourceBundle resource = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, locale);
+        ICUResourceBundle resource = (ICUResourceBundle)UResourceBundle.getBundleInstance(ICUData.ICU_UNIT_BASE_NAME, locale);
         for (MeasureUnit unit : MeasureUnit.getAvailable()) {
             // Currency data cannot be found here. Skip.
             if (unit instanceof Currency) {
@@ -1187,7 +1188,7 @@ public class MeasureFormat extends UFormat {
         SimplePatternFormatter result = localeIdToRangeFormat.get(forLocale);
         if (result == null) {
             ICUResourceBundle rb = (ICUResourceBundle)UResourceBundle.
-                    getBundleInstance(ICUResourceBundle.ICU_BASE_NAME, forLocale);
+                    getBundleInstance(ICUData.ICU_BASE_NAME, forLocale);
             ULocale realLocale = rb.getULocale();
             if (!forLocale.equals(realLocale)) { // if the child would inherit, then add a cache entry for it.
                 result = localeIdToRangeFormat.get(forLocale);
index 7b63d11857d940894cda2db8e338a4b42d2f2ce0..80cdba6a1dfe6e0ee6380a032025cd7802db3bfa 100644 (file)
@@ -18,6 +18,7 @@ import java.util.MissingResourceException;
 import java.util.Set;
 import java.util.TreeMap;
 
+import com.ibm.icu.impl.ICUData;
 import com.ibm.icu.impl.ICUResourceBundle;
 import com.ibm.icu.util.Measure;
 import com.ibm.icu.util.TimeUnit;
@@ -365,7 +366,7 @@ public class TimeUnitFormat extends MeasureFormat {
         // fill timeUnitToCountToPatterns from resource file
         try {
             ICUResourceBundle resource = (ICUResourceBundle) UResourceBundle.getBundleInstance(
-                    ICUResourceBundle.ICU_BASE_NAME, locale);
+                    ICUData.ICU_UNIT_BASE_NAME, locale);
             ICUResourceBundle unitsRes = resource.getWithFallback(resourceKey);
             int size = unitsRes.getSize();
             for (int index = 0; index < size; ++index) {
@@ -469,7 +470,7 @@ public class TimeUnitFormat extends MeasureFormat {
             try {
                 // look for pattern for srcPluralCount in locale tree
                 ICUResourceBundle unitsRes = (ICUResourceBundle) UResourceBundle.getBundleInstance(
-                        ICUResourceBundle.ICU_BASE_NAME, parentLocale);
+                        ICUData.ICU_UNIT_BASE_NAME, parentLocale);
                 unitsRes = unitsRes.getWithFallback(resourceKey);
                 ICUResourceBundle oneUnitRes = unitsRes.getWithFallback(srcTimeUnitName);
                 String pattern = oneUnitRes.getStringWithFallback(searchPluralCount);
index d9c4dd13d3f6fc046ec3c127e52e3cb5f261640f..36da2829e31563f456f42286890dffebf57726c9 100755 (executable)
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:a27318a8ad0493a3960fdef1c6f169594722a03d812977640c7af973c78d6a99
-size 11792149
+oid sha256:c469599b963026f5504a02daaf5690bf7c9b63d4108d2172a68b4ff1a394d089
+size 11883422
index cbf91cd6bf626b96f2faf79f67eb7bd25ef367a7..db6933a5cb7f74af1b8cdd53f42eb10b1b2ecfdd 100755 (executable)
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:b93b46b45434c661182c8908721c33a5055a5fc408a3fc8b13336407c44526ff
+oid sha256:c0efc727431135e8f7b445ef4049f728b138a3dcb389cbdffc8f256657f0d8ed
 size 90808