/*
- * default constructor
+ * default constructor; private because we don't want anyone to use
*/
+ @SuppressWarnings("unused")
private DateIntervalFormat() {
}
* 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.
*/
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;
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.
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
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;
}
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) {