]> granicus.if.org Git - icu/commitdiff
ICU-9407 Fixed problems, added other necessary internal API
authorMark Davis <mark@macchiato.com>
Sat, 7 Jul 2012 00:51:16 +0000 (00:51 +0000)
committerMark Davis <mark@macchiato.com>
Sat, 7 Jul 2012 00:51:16 +0000 (00:51 +0000)
X-SVN-Rev: 32028

icu4j/main/classes/core/src/com/ibm/icu/text/DateIntervalFormat.java
icu4j/main/classes/core/src/com/ibm/icu/text/DateIntervalInfo.java
icu4j/main/classes/core/src/com/ibm/icu/text/DateTimePatternGenerator.java

index 7a9127cdf9d73fee33e2541dc625ed4cf29d22c7..444ca0e99a63beef3ff85af2f28958ec9f547fea 100644 (file)
@@ -313,8 +313,9 @@ public class DateIntervalFormat extends UFormat {
     
    
     /*
-     * default constructor 
+     * default constructor; private because we don't want anyone to use 
      */
+    @SuppressWarnings("unused")
     private DateIntervalFormat() {
     }
 
@@ -327,9 +328,11 @@ public class DateIntervalFormat extends UFormat {
      * has a pattern in it.
      * the DateIntervalInfo provides the interval patterns.
      *
-     * @param locale    the locale of this date interval formatter.
-     * @param dtitvinf  the DateIntervalInfo object to be adopted.
      * @param skeleton  the skeleton of the date formatter
+     * @param dtItvInfo  the DateIntervalInfo object to be adopted.
+     * @param generator  will be used for matching
+     * @param simpleDateFormat will be used for formatting
+     * 
      * @internal
      * @deprecated This API is ICU internal only.
      */
index 04afe09ebe021b083fa90bc7b34cb8241eb20154..c6e080535d50f16b39821cceee76ec06607fe3f0 100644 (file)
@@ -8,11 +8,15 @@
 package com.ibm.icu.text;
 
 import java.io.Serializable;
+import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
+import java.util.LinkedHashMap;
+import java.util.LinkedHashSet;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.MissingResourceException;
+import java.util.Set;
 
 import com.ibm.icu.impl.ICUCache;
 import com.ibm.icu.impl.ICUResourceBundle;
@@ -20,10 +24,10 @@ import com.ibm.icu.impl.SimpleCache;
 import com.ibm.icu.impl.Utility;
 import com.ibm.icu.util.Calendar;
 import com.ibm.icu.util.Freezable;
+import com.ibm.icu.util.Region;
 import com.ibm.icu.util.ULocale;
 import com.ibm.icu.util.UResourceBundle;
 
-
 /**
  * DateIntervalInfo is a public class for encapsulating localizable
  * date time interval patterns. It is used by DateIntervalFormat.
@@ -947,4 +951,16 @@ public class DateIntervalInfo implements Cloneable, Freezable<DateIntervalInfo>,
     public int hashCode() {
         return fIntervalPatterns.hashCode();
     }
+    
+    /**
+     * @internal CLDR
+     * @deprecated This API is ICU internal only.
+     */
+    public Map<String,Set<String>> getPatterns() {
+        LinkedHashMap<String,Set<String>> result = new LinkedHashMap<String,Set<String>>();
+        for (Entry<String, Map<String, PatternInfo>> entry : fIntervalPatterns.entrySet()) {
+            result.put(entry.getKey(), new LinkedHashSet<String>(entry.getValue().keySet()));
+        }
+        return result;
+    }
 }// end class DateIntervalInfo
index d4590d313c9855d5618105d14124e0b5cd344b44..bf8154081b855e74eb242de7eae9f893edfee07a 100644 (file)
@@ -355,7 +355,11 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
         return -1;
     }*/
 
-    private static int getAppendFormatNumber(String string) {
+    /**
+     * @internal CLDR
+     * @deprecated This API is ICU internal only.
+     */
+    public static int getAppendFormatNumber(String string) {
         for (int i = 0; i < CLDR_FIELD_APPEND.length; ++i) {
             if (CLDR_FIELD_APPEND[i].equals(string)) return i;
         }
@@ -520,7 +524,9 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
         if (previousPatternWithSameBase != null) {
             returnInfo.status = PatternInfo.BASE_CONFLICT;
             returnInfo.conflictingPattern = previousPatternWithSameBase.pattern;
-            if (!override || (skeletonToUse != null && previousPatternWithSameBase.skeletonWasSpecified)) return this;
+            if (!override || (skeletonToUse != null && previousPatternWithSameBase.skeletonWasSpecified)) {
+                return this;
+            }
         }
         PatternWithSkeletonFlag previousValue = skeleton2pattern.get(matcher);
         if (previousValue != null) {