ICU-9407 Fixed problems, added other necessary internal API

X-SVN-Rev: 32028
This commit is contained in:
Mark Davis 2012-07-07 00:51:16 +00:00
parent b15c2bbf3b
commit 6192163b9d
3 changed files with 31 additions and 6 deletions

View 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.
*/

View 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

View 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) {