ICU-8022 API status promotion for 4.6 release. Update APIChangeReport.html.
X-SVN-Rev: 29026
This commit is contained in:
parent
b21e2734dd
commit
33e107f735
@ -2,11 +2,11 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>ICU4J API Comparison: ICU4J 4.4 with ICU4J 4.5.2</title>
|
||||
<title>ICU4J API Comparison: ICU4J 4.4 with ICU4J 4.6</title>
|
||||
<!-- Copyright 2010, IBM, All Rights Reserved. -->
|
||||
</head>
|
||||
<body>
|
||||
<h1>ICU4J API Comparison: ICU4J 4.4 with ICU4J 4.5.2</h1>
|
||||
<h1>ICU4J API Comparison: ICU4J 4.4 with ICU4J 4.6</h1>
|
||||
|
||||
<hr/>
|
||||
<h2>Removed from ICU4J 4.4</h2>
|
||||
@ -27,11 +27,11 @@ ULocale.Builder
|
||||
|
||||
|
||||
<hr/>
|
||||
<h2>Deprecated or Obsoleted in ICU4J 4.5.2</h2>
|
||||
<h2>Deprecated or Obsoleted in ICU4J 4.6</h2>
|
||||
<p>(no API obsoleted)</p>
|
||||
|
||||
<hr/>
|
||||
<h2>Changed in ICU4J 4.5.2 (old, new)</h2>
|
||||
<h2>Changed in ICU4J 4.6 (old, new)</h2>
|
||||
|
||||
<h3>Package com.ibm.icu.util</h3>
|
||||
<ul>
|
||||
@ -41,11 +41,136 @@ ULocale.Builder
|
||||
|
||||
|
||||
<hr/>
|
||||
<h2>Promoted to stable in ICU4J 4.5.2</h2>
|
||||
<p>(no API promoted)</p>
|
||||
<h2>Promoted to stable in ICU4J 4.6</h2>
|
||||
|
||||
<h3>Package com.ibm.icu.lang</h3>
|
||||
<ul>
|
||||
UCharacter
|
||||
<ul>
|
||||
<li>(stable) public static int <i>getCharFromNameAlias</i>(java.lang.String)</li>
|
||||
<li>(stable) public static java.lang.String <i>getNameAlias</i>(int)</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<h3>Package com.ibm.icu.text</h3>
|
||||
<ul>
|
||||
<li>(stable) public class <i>FilteredNormalizer2</i></li>
|
||||
<li>(stable) public abstract class <i>LocaleDisplayNames</i></li>
|
||||
<li>(stable) public static final class <i>LocaleDisplayNames.DialectHandling</i></li>
|
||||
<li>(stable) public abstract class <i>Normalizer2</i></li>
|
||||
<li>(stable) public static final class <i>Normalizer2.Mode</i></li>
|
||||
<li>(stable) public class <i>SelectFormat</i></li>
|
||||
<li>(stable) public interface <i>Transform</i></li>
|
||||
<li>(stable) public static final class <i>UnicodeSet.ComparisonStyle</i></li>
|
||||
<li>(stable) public static final class <i>UnicodeSet.SpanCondition</i></li>
|
||||
ArabicShaping
|
||||
<ul>
|
||||
<li>(stable) public static final int LAMALEF_AUTO</li>
|
||||
<li>(stable) public static final int LAMALEF_BEGIN</li>
|
||||
<li>(stable) public static final int LAMALEF_END</li>
|
||||
<li>(stable) public static final int LAMALEF_MASK</li>
|
||||
<li>(stable) public static final int LAMALEF_NEAR</li>
|
||||
<li>(stable) public static final int LAMALEF_RESIZE</li>
|
||||
<li>(stable) public static final int SEEN_MASK</li>
|
||||
<li>(stable) public static final int SEEN_TWOCELL_NEAR</li>
|
||||
<li>(stable) public static final int SHAPE_TAIL_NEW_UNICODE</li>
|
||||
<li>(stable) public static final int SHAPE_TAIL_TYPE_MASK</li>
|
||||
<li>(stable) public static final int SPACES_RELATIVE_TO_TEXT_BEGIN_END</li>
|
||||
<li>(stable) public static final int SPACES_RELATIVE_TO_TEXT_MASK</li>
|
||||
<li>(stable) public static final int TASHKEEL_BEGIN</li>
|
||||
<li>(stable) public static final int TASHKEEL_END</li>
|
||||
<li>(stable) public static final int TASHKEEL_MASK</li>
|
||||
<li>(stable) public static final int TASHKEEL_REPLACE_BY_TATWEEL</li>
|
||||
<li>(stable) public static final int TASHKEEL_RESIZE</li>
|
||||
<li>(stable) public static final int TEXT_DIRECTION_VISUAL_RTL</li>
|
||||
<li>(stable) public static final int YEHHAMZA_MASK</li>
|
||||
<li>(stable) public static final int YEHHAMZA_TWOCELL_NEAR</li>
|
||||
</ul>
|
||||
ChineseDateFormat
|
||||
<ul>
|
||||
<li>(stable) public <i>ChineseDateFormat</i>(java.lang.String, java.lang.String, ULocale)</li>
|
||||
</ul>
|
||||
DateTimePatternGenerator
|
||||
<ul>
|
||||
<li>(stable) public static final int MATCH_ALL_FIELDS_LENGTH</li>
|
||||
<li>(stable) public static final int MATCH_HOUR_FIELD_LENGTH</li>
|
||||
<li>(stable) public static final int MATCH_NO_OPTIONS</li>
|
||||
<li>(stable) public java.lang.String <i>getBestPattern</i>(java.lang.String, int)</li>
|
||||
<li>(stable) public java.lang.String <i>replaceFieldTypes</i>(java.lang.String, java.lang.String, int)</li>
|
||||
</ul>
|
||||
DecimalFormatSymbols
|
||||
<ul>
|
||||
<li>(stable) public static final int CURRENCY_SPC_CURRENCY_MATCH</li>
|
||||
<li>(stable) public static final int CURRENCY_SPC_INSERT</li>
|
||||
<li>(stable) public static final int CURRENCY_SPC_SURROUNDING_MATCH</li>
|
||||
<li>(stable) public java.lang.String <i>getPatternForCurrencySpacing</i>(int, boolean)</li>
|
||||
<li>(stable) public void <i>setPatternForCurrencySpacing</i>(int, boolean, java.lang.String)</li>
|
||||
</ul>
|
||||
UnicodeSet
|
||||
<ul>
|
||||
<li>(stable) public <i>UnicodeSet</i>(int...)</li>
|
||||
<li>(stable) public UnicodeSet <i>addAll</i>(int, int)</li>
|
||||
<li>(stable) public UnicodeSet <i>addAll</i>(java.lang.String...)</li>
|
||||
<li>(stable) public T extends java.util.Collection<java.lang.String> <i>addAllTo</i>(T)</li>
|
||||
<li>(stable) public static T[] <i>addAllTo</i>(java.lang.Iterable<T>, T[])</li>
|
||||
<li>(stable) public static U extends java.util.Collection<T> <i>addAllTo</i>(java.lang.Iterable<T>, U)</li>
|
||||
<li>(stable) public java.lang.String[] <i>addAllTo</i>(java.lang.String[])</li>
|
||||
<li>(stable) public static int <i>compare</i>(int, java.lang.String)</li>
|
||||
<li>(stable) public static int <i>compare</i>(java.lang.Iterable<T>, java.lang.Iterable<T>)</li>
|
||||
<li>(stable) public static int <i>compare</i>(java.lang.String, int)</li>
|
||||
<li>(stable) public static int <i>compare</i>(java.util.Collection<T>, java.util.Collection<T>, UnicodeSet.ComparisonStyle)</li>
|
||||
<li>(stable) public int <i>compareTo</i>(UnicodeSet)</li>
|
||||
<li>(stable) public int <i>compareTo</i>(UnicodeSet, UnicodeSet.ComparisonStyle)</li>
|
||||
<li>(stable) public int <i>compareTo</i>(java.lang.Iterable<java.lang.String>)</li>
|
||||
<li>(stable) public boolean <i>containsAll</i>(java.util.Collection<java.lang.String>)</li>
|
||||
<li>(stable) public boolean <i>containsNone</i>(java.util.Collection<java.lang.String>)</li>
|
||||
<li>(stable) public final boolean <i>containsSome</i>(java.util.Collection<java.lang.String>)</li>
|
||||
<li>(stable) public java.util.Iterator<java.lang.String> <i>iterator</i>()</li>
|
||||
<li>(stable) public UnicodeSet <i>removeAll</i>(java.util.Collection<java.lang.String>)</li>
|
||||
<li>(stable) public UnicodeSet <i>retainAll</i>(java.util.Collection<java.lang.String>)</li>
|
||||
<li>(stable) public int <i>span</i>(java.lang.CharSequence, UnicodeSet.SpanCondition)</li>
|
||||
<li>(stable) public int <i>span</i>(java.lang.CharSequence, int, UnicodeSet.SpanCondition)</li>
|
||||
<li>(stable) public int <i>spanBack</i>(java.lang.CharSequence, UnicodeSet.SpanCondition)</li>
|
||||
<li>(stable) public int <i>spanBack</i>(java.lang.CharSequence, int, UnicodeSet.SpanCondition)</li>
|
||||
<li>(stable) public java.lang.Iterable<java.lang.String> <i>strings</i>()</li>
|
||||
<li>(stable) public static java.lang.String[] <i>toArray</i>(UnicodeSet)</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
<h3>Package com.ibm.icu.util</h3>
|
||||
<ul>
|
||||
<li>(stable) public class <i>LocaleMatcher</i></li>
|
||||
<li>(stable) public class <i>LocalePriorityList</i></li>
|
||||
<li>(stable) public static class <i>LocalePriorityList.Builder</i></li>
|
||||
Calendar
|
||||
<ul>
|
||||
<li>(stable) public static final int IS_LEAP_MONTH</li>
|
||||
</ul>
|
||||
TimeZone
|
||||
<ul>
|
||||
<li>(stable) public static final int GENERIC_LOCATION</li>
|
||||
<li>(stable) public static final int LONG_GENERIC</li>
|
||||
<li>(stable) public static final int LONG_GMT</li>
|
||||
<li>(stable) public static final int SHORT_COMMONLY_USED</li>
|
||||
<li>(stable) public static final int SHORT_GENERIC</li>
|
||||
<li>(stable) public static final int SHORT_GMT</li>
|
||||
</ul>
|
||||
ULocale
|
||||
<ul>
|
||||
<li>(stable) public java.lang.String <i>getDisplayLanguageWithDialect</i>()</li>
|
||||
<li>(stable) public java.lang.String <i>getDisplayLanguageWithDialect</i>(ULocale)</li>
|
||||
<li>(stable) public static java.lang.String <i>getDisplayLanguageWithDialect</i>(java.lang.String, ULocale)</li>
|
||||
<li>(stable) public static java.lang.String <i>getDisplayLanguageWithDialect</i>(java.lang.String, java.lang.String)</li>
|
||||
<li>(stable) public java.lang.String <i>getDisplayNameWithDialect</i>()</li>
|
||||
<li>(stable) public java.lang.String <i>getDisplayNameWithDialect</i>(ULocale)</li>
|
||||
<li>(stable) public static java.lang.String <i>getDisplayNameWithDialect</i>(java.lang.String, ULocale)</li>
|
||||
<li>(stable) public static java.lang.String <i>getDisplayNameWithDialect</i>(java.lang.String, java.lang.String)</li>
|
||||
</ul>
|
||||
</ul>
|
||||
|
||||
|
||||
<hr/>
|
||||
<h2>Added in ICU4J 4.5.2</h2>
|
||||
<h2>Added in ICU4J 4.6</h2>
|
||||
|
||||
<h3>Package com.ibm.icu.lang</h3>
|
||||
<ul>
|
||||
@ -140,22 +265,11 @@ IDNA
|
||||
<li>(draft) public static final int CHECK_CONTEXTJ</li>
|
||||
<li>(draft) public static final int NONTRANSITIONAL_TO_ASCII</li>
|
||||
<li>(draft) public static final int NONTRANSITIONAL_TO_UNICODE</li>
|
||||
<li>(draft) protected static void <i>addError</i>(IDNA.Info, IDNA.Error)</li>
|
||||
<li>(draft) protected static void <i>addLabelError</i>(IDNA.Info, IDNA.Error)</li>
|
||||
<li>(draft) public static IDNA <i>getUTS46Instance</i>(int)</li>
|
||||
<li>(draft) protected static boolean <i>hasCertainErrors</i>(IDNA.Info, java.util.EnumSet<IDNA.Error>)</li>
|
||||
<li>(draft) protected static boolean <i>hasCertainLabelErrors</i>(IDNA.Info, java.util.EnumSet<IDNA.Error>)</li>
|
||||
<li>(draft) protected static boolean <i>isBiDi</i>(IDNA.Info)</li>
|
||||
<li>(draft) protected static boolean <i>isOkBiDi</i>(IDNA.Info)</li>
|
||||
<li>(draft) public abstract java.lang.StringBuilder <i>labelToASCII</i>(java.lang.CharSequence, java.lang.StringBuilder, IDNA.Info)</li>
|
||||
<li>(draft) public abstract java.lang.StringBuilder <i>labelToUnicode</i>(java.lang.CharSequence, java.lang.StringBuilder, IDNA.Info)</li>
|
||||
<li>(draft) public abstract java.lang.StringBuilder <i>nameToASCII</i>(java.lang.CharSequence, java.lang.StringBuilder, IDNA.Info)</li>
|
||||
<li>(draft) public abstract java.lang.StringBuilder <i>nameToUnicode</i>(java.lang.CharSequence, java.lang.StringBuilder, IDNA.Info)</li>
|
||||
<li>(draft) protected static void <i>promoteAndResetLabelErrors</i>(IDNA.Info)</li>
|
||||
<li>(draft) protected static void <i>resetInfo</i>(IDNA.Info)</li>
|
||||
<li>(draft) protected static void <i>setBiDi</i>(IDNA.Info)</li>
|
||||
<li>(draft) protected static void <i>setNotOkBiDi</i>(IDNA.Info)</li>
|
||||
<li>(draft) protected static void <i>setTransitionalDifferent</i>(IDNA.Info)</li>
|
||||
</ul>
|
||||
Normalizer2
|
||||
<ul>
|
||||
@ -171,6 +285,10 @@ ChineseCalendar
|
||||
<li>(draft) public <i>ChineseCalendar</i>(int, int, int, int, int)</li>
|
||||
<li>(draft) public <i>ChineseCalendar</i>(int, int, int, int, int, int, int, int)</li>
|
||||
</ul>
|
||||
Currency
|
||||
<ul>
|
||||
<li>(draft) public static boolean <i>isAvailable</i>(java.lang.String, java.util.Date, java.util.Date)</li>
|
||||
</ul>
|
||||
IllformedLocaleException
|
||||
<ul>
|
||||
<li>(draft) public <i>IllformedLocaleException</i>()</li>
|
||||
@ -198,6 +316,6 @@ VersionInfo
|
||||
</ul>
|
||||
|
||||
<hr/>
|
||||
<p><i><font size="-1">Contents generated by ReportAPI tool on Wed Sep 29 17:32:01 EDT 2010<br/>Copyright (C) 2010, International Business Machines Corporation, All Rights Reserved.</font></i></p>
|
||||
<p><i><font size="-1">Contents generated by ReportAPI tool on Thu Nov 11 01:21:40 EST 2010<br/>Copyright (C) 2010, International Business Machines Corporation, All Rights Reserved.</font></i></p>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -4047,8 +4047,7 @@ public final class UCharacter implements ECharacterCategory, ECharacterDirection
|
||||
* incurs a one-time initialisation cost to construct the name tables.
|
||||
* @param ch the code point for which to get the name alias
|
||||
* @return Unicode name alias, or null
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String getNameAlias(int ch)
|
||||
{
|
||||
@ -4141,8 +4140,7 @@ public final class UCharacter implements ECharacterCategory, ECharacterDirection
|
||||
* incurs a one-time initialisation cost to construct the name tables.
|
||||
* @param name Unicode name alias whose code point is to be returned
|
||||
* @return code point or -1 if name is not found
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static int getCharFromNameAlias(String name){
|
||||
return UCharacterName.INSTANCE.getCharFromName(UCharacterNameChoice.CHAR_NAME_ALIAS, name);
|
||||
|
@ -81,7 +81,7 @@ public class ChineseDateFormat extends SimpleDateFormat {
|
||||
* string by separating them with a semi-colon. For example, the override string "m=thai;y=deva" would format using
|
||||
* Thai digits for the month and Devanagari digits for the year.
|
||||
* @param locale the locale
|
||||
* @draft ICU 4.2
|
||||
* @stable ICU 4.2
|
||||
*/
|
||||
public ChineseDateFormat(String pattern, String override, ULocale locale) {
|
||||
super(pattern, new ChineseDateFormatSymbols(locale),
|
||||
|
@ -384,8 +384,7 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
||||
* the returned pattern to match those in the skeleton (when this would
|
||||
* not happen otherwise). For default behavior, use MATCH_NO_OPTIONS.
|
||||
* @return Best pattern matching the input skeleton (and options).
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String getBestPattern(String skeleton, int options) {
|
||||
return getBestPattern(skeleton, null, options);
|
||||
@ -625,8 +624,7 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
||||
* the returned pattern to match those in the skeleton (when this would
|
||||
* not happen otherwise). For default behavior, use MATCH_NO_OPTIONS.
|
||||
* @return pattern adjusted to match the skeleton fields widths and subtypes.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String replaceFieldTypes(String pattern, String skeleton, int options) {
|
||||
synchronized (this) { // synchronized since a getter must be thread-safe
|
||||
@ -836,32 +834,41 @@ public class DateTimePatternGenerator implements Freezable<DateTimePatternGenera
|
||||
// Option masks for getBestPattern, replaceFieldTypes (individual masks may be ORed together)
|
||||
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* Default option mask used for {@link #getBestPattern(String, int)}
|
||||
* and {@link #replaceFieldTypes(String, String, int)}.
|
||||
* @stable ICU 4.4
|
||||
* @see #getBestPattern(String, int)
|
||||
* @see #replaceFieldTypes(String, String, int)
|
||||
*/
|
||||
public static final int MATCH_NO_OPTIONS = 0;
|
||||
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* Option mask for forcing the width of hour field.
|
||||
* @stable ICU 4.4
|
||||
* @see #getBestPattern(String, int)
|
||||
* @see #replaceFieldTypes(String, String, int)
|
||||
*/
|
||||
public static final int MATCH_HOUR_FIELD_LENGTH = 1 << HOUR;
|
||||
|
||||
/**
|
||||
* @internal ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* Option mask for forcing the width of minute field.
|
||||
* @internal
|
||||
* @deprecated This API is ICU internal only.
|
||||
*/
|
||||
public static final int MATCH_MINUTE_FIELD_LENGTH = 1 << MINUTE;
|
||||
|
||||
/**
|
||||
* @internal ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* Option mask for forcing the width of second field.
|
||||
* @internal
|
||||
* @deprecated This API is ICU internal only.
|
||||
*/
|
||||
public static final int MATCH_SECOND_FIELD_LENGTH = 1 << SECOND;
|
||||
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* Option mask for forcing the width of all date and time fields.
|
||||
* @stable ICU 4.4
|
||||
* @see #getBestPattern(String, int)
|
||||
* @see #replaceFieldTypes(String, String, int)
|
||||
*/
|
||||
public static final int MATCH_ALL_FIELDS_LENGTH = (1 << TYPE_LIMIT) - 1;
|
||||
|
||||
|
@ -612,20 +612,20 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
||||
|
||||
/**
|
||||
* {@icu} Indicates the currency match pattern used in {@link #getPatternForCurrencySpacing}.
|
||||
* @draft ICU 4.2
|
||||
* @stable ICU 4.2
|
||||
*/
|
||||
public static final int CURRENCY_SPC_CURRENCY_MATCH = 0;
|
||||
|
||||
/**
|
||||
* {@icu} Indicates the surrounding match pattern used in {@link
|
||||
* #getPatternForCurrencySpacing}.
|
||||
* @draft ICU 4.2
|
||||
* @stable ICU 4.2
|
||||
*/
|
||||
public static final int CURRENCY_SPC_SURROUNDING_MATCH = 1;
|
||||
|
||||
/**
|
||||
* {@icu} Indicates the insertion value used in {@link #getPatternForCurrencySpacing}.
|
||||
* @draft ICU 4.4
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int CURRENCY_SPC_INSERT = 2;
|
||||
|
||||
@ -649,7 +649,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
||||
* to get the <code>afterCurrency</code> values.
|
||||
* @return the value, or null.
|
||||
* @see #setPatternForCurrencySpacing(int, boolean, String)
|
||||
* @draft ICU 4.2
|
||||
* @stable ICU 4.2
|
||||
*/
|
||||
public String getPatternForCurrencySpacing(int itemType, boolean beforeCurrency) {
|
||||
if (itemType < CURRENCY_SPC_CURRENCY_MATCH ||
|
||||
@ -677,7 +677,7 @@ public class DecimalFormatSymbols implements Cloneable, Serializable {
|
||||
* false if the pattern is for after it.
|
||||
* @param pattern string to override current setting; can be null.
|
||||
* @see #getPatternForCurrencySpacing(int, boolean)
|
||||
* @draft ICU 4.2
|
||||
* @stable ICU 4.2
|
||||
*/
|
||||
public void setPatternForCurrencySpacing(int itemType, boolean beforeCurrency, String pattern) {
|
||||
if (itemType < CURRENCY_SPC_CURRENCY_MATCH ||
|
||||
|
@ -16,8 +16,7 @@ import java.io.IOException;
|
||||
* Not-in-the-filter text is treated as "is normalized" and "quick check yes".
|
||||
* This class implements all of (and only) the Normalizer2 API.
|
||||
* An instance of this class is unmodifiable/immutable.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
* @author Markus W. Scherer
|
||||
*/
|
||||
public class FilteredNormalizer2 extends Normalizer2 {
|
||||
@ -29,17 +28,16 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
* The filter set should be frozen; otherwise the performance will suffer greatly.
|
||||
* @param n2 wrapped Normalizer2 instance
|
||||
* @param filterSet UnicodeSet which determines the characters to be normalized
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public FilteredNormalizer2(Normalizer2 n2, UnicodeSet filterSet) {
|
||||
norm2=n2;
|
||||
set=filterSet;
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public StringBuilder normalize(CharSequence src, StringBuilder dest) {
|
||||
@ -50,10 +48,12 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
normalize(src, dest, UnicodeSet.SpanCondition.SIMPLE);
|
||||
return dest;
|
||||
}
|
||||
/** {@inheritDoc}
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.6
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
@Override
|
||||
public Appendable normalize(CharSequence src, Appendable dest) {
|
||||
if(dest==src) {
|
||||
throw new IllegalArgumentException();
|
||||
@ -61,24 +61,26 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
return normalize(src, dest, UnicodeSet.SpanCondition.SIMPLE);
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public StringBuilder normalizeSecondAndAppend(
|
||||
StringBuilder first, CharSequence second) {
|
||||
return normalizeSecondAndAppend(first, second, true);
|
||||
}
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public StringBuilder append(StringBuilder first, CharSequence second) {
|
||||
return normalizeSecondAndAppend(first, second, false);
|
||||
}
|
||||
/** {@inheritDoc}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.6
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
@ -87,9 +89,9 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
return set.contains(c) ? norm2.getDecomposition(c) : null;
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public boolean isNormalized(CharSequence s) {
|
||||
@ -108,9 +110,10 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public Normalizer.QuickCheckResult quickCheck(CharSequence s) {
|
||||
@ -134,9 +137,9 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public int spanQuickCheckYes(CharSequence s) {
|
||||
@ -159,27 +162,27 @@ public class FilteredNormalizer2 extends Normalizer2 {
|
||||
return s.length();
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public boolean hasBoundaryBefore(int c) {
|
||||
return !set.contains(c) || norm2.hasBoundaryBefore(c);
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public boolean hasBoundaryAfter(int c) {
|
||||
return !set.contains(c) || norm2.hasBoundaryAfter(c);
|
||||
}
|
||||
|
||||
/** {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public boolean isInert(int c) {
|
||||
|
@ -15,28 +15,24 @@ import com.ibm.icu.util.ULocale;
|
||||
* Returns display names of ULocales and components of ULocales. For
|
||||
* more information on language, script, region, variant, key, and
|
||||
* values, see {@link com.ibm.icu.util.ULocale}.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract class LocaleDisplayNames {
|
||||
/**
|
||||
* Enum used in {@link #getInstance(ULocale, DialectHandling)}.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public enum DialectHandling {
|
||||
/**
|
||||
* Use standard names when generating a locale name,
|
||||
* e.g. en_GB displays as 'English (United Kingdom)'.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
STANDARD_NAMES,
|
||||
/**
|
||||
* Use dialect names when generating a locale name,
|
||||
* e.g. en_GB displays as 'British English'.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
DIALECT_NAMES
|
||||
}
|
||||
@ -47,8 +43,7 @@ public abstract class LocaleDisplayNames {
|
||||
* STANDARD dialect handling.
|
||||
* @param locale the display locale
|
||||
* @return a LocaleDisplayNames instance
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static LocaleDisplayNames getInstance(ULocale locale) {
|
||||
return getInstance(locale, DialectHandling.STANDARD_NAMES);
|
||||
@ -60,8 +55,7 @@ public abstract class LocaleDisplayNames {
|
||||
* @param locale the display locale
|
||||
* @param dialectHandling how to select names for locales
|
||||
* @return a LocaleDisplayNames instance
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static LocaleDisplayNames getInstance(ULocale locale, DialectHandling dialectHandling) {
|
||||
return LocaleDisplayNamesImpl.getInstance(locale, dialectHandling);
|
||||
@ -72,16 +66,14 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the locale used to determine the display names. This is not necessarily the same
|
||||
* locale passed to {@link #getInstance}.
|
||||
* @return the display locale
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract ULocale getLocale();
|
||||
|
||||
/**
|
||||
* Returns the dialect handling used in the display names.
|
||||
* @return the dialect handling enum
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract DialectHandling getDialectHandling();
|
||||
|
||||
@ -90,8 +82,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided ulocale.
|
||||
* @param locale the locale whose display name to return
|
||||
* @return the display name of the provided locale
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String localeDisplayName(ULocale locale);
|
||||
|
||||
@ -99,8 +90,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided locale.
|
||||
* @param locale the locale whose display name to return
|
||||
* @return the display name of the provided locale
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String localeDisplayName(Locale locale);
|
||||
|
||||
@ -108,8 +98,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided locale id.
|
||||
* @param localeId the id of the locale whose display name to return
|
||||
* @return the display name of the provided locale
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String localeDisplayName(String localeId);
|
||||
|
||||
@ -118,8 +107,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided language code.
|
||||
* @param lang the language code
|
||||
* @return the display name of the provided language code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String languageDisplayName(String lang);
|
||||
|
||||
@ -127,8 +115,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided script code.
|
||||
* @param script the script code
|
||||
* @return the display name of the provided script code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String scriptDisplayName(String script);
|
||||
|
||||
@ -137,8 +124,7 @@ public abstract class LocaleDisplayNames {
|
||||
* {@link com.ibm.icu.lang.UScript} for recognized script codes.
|
||||
* @param scriptCode the script code number
|
||||
* @return the display name of the provided script code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String scriptDisplayName(int scriptCode);
|
||||
|
||||
@ -146,8 +132,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided region code.
|
||||
* @param region the region code
|
||||
* @return the display name of the provided region code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String regionDisplayName(String region);
|
||||
|
||||
@ -155,8 +140,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided variant.
|
||||
* @param variant the variant string
|
||||
* @return the display name of the provided variant
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String variantDisplayName(String variant);
|
||||
|
||||
@ -164,8 +148,7 @@ public abstract class LocaleDisplayNames {
|
||||
* Returns the display name of the provided locale key.
|
||||
* @param key the locale key name
|
||||
* @return the display name of the provided locale key
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String keyDisplayName(String key);
|
||||
|
||||
@ -174,8 +157,7 @@ public abstract class LocaleDisplayNames {
|
||||
* @param key the locale key name
|
||||
* @param value the locale key's value
|
||||
* @return the display name of the provided value
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract String keyValueDisplayName(String key, String value);
|
||||
|
||||
|
@ -50,8 +50,7 @@ import com.ibm.icu.impl.Norm2AllModes;
|
||||
* The set of normalization boundaries returned by these functions may not be
|
||||
* complete: There may be more boundaries that could be returned.
|
||||
* Different functions may return different boundaries.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
* @author Markus W. Scherer
|
||||
*/
|
||||
public abstract class Normalizer2 {
|
||||
@ -60,8 +59,7 @@ public abstract class Normalizer2 {
|
||||
* For details about standard Unicode normalization forms
|
||||
* and about the algorithms which are also used with custom mapping tables
|
||||
* see http://www.unicode.org/unicode/reports/tr15/
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public enum Mode {
|
||||
/**
|
||||
@ -70,8 +68,7 @@ public abstract class Normalizer2 {
|
||||
* Same as standard NFKC when using an "nfkc" instance.
|
||||
* For details about standard Unicode normalization forms
|
||||
* see http://www.unicode.org/unicode/reports/tr15/
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
COMPOSE,
|
||||
/**
|
||||
@ -80,8 +77,7 @@ public abstract class Normalizer2 {
|
||||
* Same as standard NFKD when using an "nfkc" instance.
|
||||
* For details about standard Unicode normalization forms
|
||||
* see http://www.unicode.org/unicode/reports/tr15/
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
DECOMPOSE,
|
||||
/**
|
||||
@ -94,8 +90,7 @@ public abstract class Normalizer2 {
|
||||
* Not a standard Unicode normalization form.<br>
|
||||
* Not a unique form: Different FCD strings can be canonically equivalent.<br>
|
||||
* For details see http://www.unicode.org/notes/tn5/#FCD
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
FCD,
|
||||
/**
|
||||
@ -105,8 +100,7 @@ public abstract class Normalizer2 {
|
||||
* The result will conform to FCD which is useful for processing.<br>
|
||||
* Not a standard Unicode normalization form.<br>
|
||||
* For details see http://www.unicode.org/notes/tn5/#FCC
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
COMPOSE_CONTIGUOUS
|
||||
};
|
||||
@ -130,8 +124,7 @@ public abstract class Normalizer2 {
|
||||
* @param name "nfc" or "nfkc" or "nfkc_cf" or name of custom data file
|
||||
* @param mode normalization mode (compose or decompose etc.)
|
||||
* @return the requested Normalizer2, if successful
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static Normalizer2 getInstance(InputStream data, String name, Mode mode) {
|
||||
Norm2AllModes all2Modes=Norm2AllModes.getInstance(data, name);
|
||||
@ -148,12 +141,12 @@ public abstract class Normalizer2 {
|
||||
* Returns the normalized form of the source string.
|
||||
* @param src source string
|
||||
* @return normalized src
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String normalize(CharSequence src) {
|
||||
return normalize(src, new StringBuilder()).toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Writes the normalized form of the source string to the destination string
|
||||
* (replacing its contents) and returns the destination string.
|
||||
@ -161,10 +154,10 @@ public abstract class Normalizer2 {
|
||||
* @param src source string
|
||||
* @param dest destination string; its contents is replaced with normalized src
|
||||
* @return dest
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract StringBuilder normalize(CharSequence src, StringBuilder dest);
|
||||
|
||||
/**
|
||||
* Writes the normalized form of the source string to the destination Appendable
|
||||
* and returns the destination Appendable.
|
||||
@ -176,6 +169,7 @@ public abstract class Normalizer2 {
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*/
|
||||
public abstract Appendable normalize(CharSequence src, Appendable dest);
|
||||
|
||||
/**
|
||||
* Appends the normalized form of the second string to the first string
|
||||
* (merging them at the boundary) and returns the first string.
|
||||
@ -184,11 +178,11 @@ public abstract class Normalizer2 {
|
||||
* @param first string, should be normalized
|
||||
* @param second string, will be normalized
|
||||
* @return first
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract StringBuilder normalizeSecondAndAppend(
|
||||
StringBuilder first, CharSequence second);
|
||||
|
||||
/**
|
||||
* Appends the second string to the first string
|
||||
* (merging them at the boundary) and returns the first string.
|
||||
@ -197,10 +191,10 @@ public abstract class Normalizer2 {
|
||||
* @param first string, should be normalized
|
||||
* @param second string, should be normalized
|
||||
* @return first
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract StringBuilder append(StringBuilder first, CharSequence second);
|
||||
|
||||
/**
|
||||
* Gets the decomposition mapping of c. Equivalent to normalize(String(c))
|
||||
* on a DECOMPOSE Normalizer2 instance, but much faster.
|
||||
@ -220,8 +214,7 @@ public abstract class Normalizer2 {
|
||||
* at the cost of doing more work in those cases.
|
||||
* @param s input string
|
||||
* @return true if s is normalized
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract boolean isNormalized(CharSequence s);
|
||||
|
||||
@ -234,8 +227,7 @@ public abstract class Normalizer2 {
|
||||
* re-checking the "yes" prefix.
|
||||
* @param s input string
|
||||
* @return the quick check result
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract Normalizer.QuickCheckResult quickCheck(CharSequence s);
|
||||
|
||||
@ -255,8 +247,7 @@ public abstract class Normalizer2 {
|
||||
* copy that prefix and use normalizeSecondAndAppend() for the remainder.
|
||||
* @param s input string
|
||||
* @return "yes" span end index
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract int spanQuickCheckYes(CharSequence s);
|
||||
|
||||
@ -271,8 +262,7 @@ public abstract class Normalizer2 {
|
||||
* This is used for iterative normalization. See the class documentation for details.
|
||||
* @param c character to test
|
||||
* @return true if c has a normalization boundary before it
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract boolean hasBoundaryBefore(int c);
|
||||
|
||||
@ -289,8 +279,7 @@ public abstract class Normalizer2 {
|
||||
* Note that this operation may be significantly slower than hasBoundaryBefore().
|
||||
* @param c character to test
|
||||
* @return true if c has a normalization boundary after it
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract boolean hasBoundaryAfter(int c);
|
||||
|
||||
@ -306,8 +295,7 @@ public abstract class Normalizer2 {
|
||||
* Note that this operation may be significantly slower than hasBoundaryBefore().
|
||||
* @param c character to test
|
||||
* @return true if c is normalization-inert
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public abstract boolean isInert(int c);
|
||||
|
||||
|
@ -148,8 +148,7 @@ import java.util.Map;
|
||||
* <code>Kirti est all&#u00E9;e &#u00E0; Paris.</code>
|
||||
* </p>
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
|
||||
public class SelectFormat extends Format{
|
||||
@ -172,8 +171,7 @@ public class SelectFormat extends Format{
|
||||
* Common name for the default select form. This name is returned
|
||||
* for values to which no other form in the rule applies. It
|
||||
* can additionally be assigned rules of its own.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
private static final String KEYWORD_OTHER = "other";
|
||||
|
||||
@ -197,8 +195,7 @@ public class SelectFormat extends Format{
|
||||
/**
|
||||
* Creates a new <code>SelectFormat</code> for a given pattern string.
|
||||
* @param pattern the pattern for this <code>SelectFormat</code>.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public SelectFormat(String pattern) {
|
||||
init();
|
||||
@ -272,8 +269,7 @@ public class SelectFormat extends Format{
|
||||
*
|
||||
* @param pattern the pattern for this select format.
|
||||
* @throws IllegalArgumentException when the pattern is not a valid select format pattern.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public void applyPattern(String pattern) {
|
||||
parsedValues = null;
|
||||
@ -405,8 +401,7 @@ public class SelectFormat extends Format{
|
||||
* Returns the pattern for this <code>SelectFormat</code>
|
||||
*
|
||||
* @return the pattern string
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String toPattern() {
|
||||
return pattern;
|
||||
@ -418,8 +413,7 @@ public class SelectFormat extends Format{
|
||||
* @param keyword a keyword for which the select message should be formatted.
|
||||
* @return the string containing the formatted select message.
|
||||
* @throws IllegalArgumentException when the given keyword is not available in the select format pattern
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public final String format(String keyword) {
|
||||
//Check for the validity of the keyword
|
||||
@ -450,8 +444,7 @@ public class SelectFormat extends Format{
|
||||
* @throws IllegalArgumentException when the given keyword is not available in the select format pattern
|
||||
* @return the string buffer passed in as toAppendTo, with formatted text
|
||||
* appended.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public StringBuffer format(Object keyword, StringBuffer toAppendTo,
|
||||
FieldPosition pos) {
|
||||
@ -471,8 +464,7 @@ public class SelectFormat extends Format{
|
||||
* has not changed upon return, then parsing failed.
|
||||
* @return nothing because this method is not supported.
|
||||
* @throws UnsupportedOperationException thrown always.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Object parseObject(String source, ParsePosition pos) {
|
||||
throw new UnsupportedOperationException();
|
||||
@ -503,8 +495,7 @@ public class SelectFormat extends Format{
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public boolean equals(Object obj) {
|
||||
if (!(obj instanceof SelectFormat)) {
|
||||
@ -516,8 +507,7 @@ public class SelectFormat extends Format{
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int hashCode() {
|
||||
if (pattern != null) {
|
||||
@ -531,8 +521,7 @@ public class SelectFormat extends Format{
|
||||
* @return a text representation of the format object.
|
||||
* The result string includes the class name and
|
||||
* the pattern string returned by <code>toPattern()</code>.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String toString() {
|
||||
StringBuilder buf = new StringBuilder();
|
||||
|
@ -11,9 +11,8 @@ package com.ibm.icu.text;
|
||||
* APIs that take Transliterator or StringTransform, but only depend on the transformation should use this interface in the API instead.
|
||||
*
|
||||
* @author markdavis
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
*
|
||||
* @stable ICU 4.4
|
||||
|
||||
*/
|
||||
|
||||
public interface Transform<S,D> {
|
||||
@ -21,8 +20,7 @@ public interface Transform<S,D> {
|
||||
* Transform the input in some way, to be determined by the subclass.
|
||||
* @param source to be transformed (eg lowercased)
|
||||
* @return result
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public D transform(S source);
|
||||
}
|
||||
|
@ -366,8 +366,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* In each pair (..., si, ei, ...) it must be true that si <= ei
|
||||
* Between adjacent pairs (...ei, sj...), it must be true that ei+1 < sj
|
||||
* @param pairs pairs of character representing ranges
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public UnicodeSet(int... pairs) {
|
||||
if ((pairs.length & 1) != 0) {
|
||||
@ -1099,8 +1098,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* @param start The index of where to start on adding all characters.
|
||||
* @param end The index of where to end on adding all characters.
|
||||
* @return a reference to this object
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public UnicodeSet addAll(int start, int end) {
|
||||
checkFrozen();
|
||||
@ -2717,8 +2715,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
/**
|
||||
* Add the contents of the UnicodeSet (as strings) into a collection.
|
||||
* @param target collection to add into
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public <T extends Collection<String>> T addAllTo(T target) {
|
||||
return addAllTo(this, target);
|
||||
@ -2728,8 +2725,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
/**
|
||||
* Add the contents of the UnicodeSet (as strings) into a collection.
|
||||
* @param target collection to add into
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String[] addAllTo(String[] target) {
|
||||
return addAllTo(this, target);
|
||||
@ -2737,8 +2733,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* Add the contents of the UnicodeSet (as strings) into an array.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String[] toArray(UnicodeSet set) {
|
||||
return addAllTo(set, new String[set.size()]);
|
||||
@ -3875,8 +3870,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* @param s The string to be spanned
|
||||
* @param spanCondition The span condition
|
||||
* @return the length of the span
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int span(CharSequence s, SpanCondition spanCondition) {
|
||||
return span(s, 0, spanCondition);
|
||||
@ -3891,8 +3885,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* @param start The start index that the span begins
|
||||
* @param spanCondition The span condition
|
||||
* @return the string index which ends the span (i.e. exclusive)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int span(CharSequence s, int start, SpanCondition spanCondition) {
|
||||
int end = s.length();
|
||||
@ -3937,8 +3930,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* @param s The string to be spanned
|
||||
* @param spanCondition The span condition
|
||||
* @return The string index which starts the span (i.e. inclusive).
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int spanBack(CharSequence s, SpanCondition spanCondition) {
|
||||
return spanBack(s, s.length(), spanCondition);
|
||||
@ -3953,8 +3945,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* @param fromIndex The index of the char (exclusive) that the string should be spanned backwards
|
||||
* @param spanCondition The span condition
|
||||
* @return The string index which starts the span (i.e. inclusive).
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int spanBack(CharSequence s, int fromIndex, SpanCondition spanCondition) {
|
||||
if (fromIndex <= 0) {
|
||||
@ -4019,8 +4010,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
/**
|
||||
* Returns a string iterator. Uses the same order of iteration as {@link UnicodeSetIterator}.
|
||||
* @see java.util.Set#iterator()
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Iterator<String> iterator() {
|
||||
return new UnicodeSetIterator2(this);
|
||||
@ -4105,8 +4095,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #containsAll(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public boolean containsAll(Collection<String> collection) {
|
||||
for (String o : collection) {
|
||||
@ -4119,8 +4108,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #containsNone(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public boolean containsNone(Collection<String> collection) {
|
||||
for (String o : collection) {
|
||||
@ -4133,8 +4121,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #containsAll(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public final boolean containsSome(Collection<String> collection) {
|
||||
return !containsNone(collection);
|
||||
@ -4142,8 +4129,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #addAll(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public UnicodeSet addAll(String... collection) {
|
||||
checkFrozen();
|
||||
@ -4156,8 +4142,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #removeAll(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public UnicodeSet removeAll(Collection<String> collection) {
|
||||
checkFrozen();
|
||||
@ -4169,8 +4154,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* @see #retainAll(com.ibm.icu.text.UnicodeSet)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public UnicodeSet retainAll(Collection<String> collection) {
|
||||
checkFrozen();
|
||||
@ -4183,32 +4167,28 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* Comparison style enums used by {@link UnicodeSet#compareTo(UnicodeSet, ComparisonStyle)}.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public enum ComparisonStyle {
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
SHORTER_FIRST,
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
LEXICOGRAPHIC,
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
LONGER_FIRST}
|
||||
LONGER_FIRST
|
||||
}
|
||||
|
||||
/**
|
||||
* Compares UnicodeSets, where shorter come first, and otherwise lexigraphically
|
||||
* (according to the comparison of the first characters that differ).
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int compareTo(UnicodeSet o) {
|
||||
return compareTo(o, ComparisonStyle.SHORTER_FIRST);
|
||||
@ -4216,8 +4196,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
/**
|
||||
* Compares UnicodeSets, in three different ways.
|
||||
* @see java.lang.Comparable#compareTo(java.lang.Object)
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int compareTo(UnicodeSet o, ComparisonStyle style) {
|
||||
if (style != ComparisonStyle.LEXICOGRAPHIC) {
|
||||
@ -4251,8 +4230,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
}
|
||||
|
||||
/**
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public int compareTo(Iterable<String> other) {
|
||||
return compare(this, other);
|
||||
@ -4263,8 +4241,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* Same results as turning the code point into a string (with the [ugly] new StringBuilder().appendCodePoint(codepoint).toString())
|
||||
* and comparing, but much faster (no object creation).
|
||||
* Note that this (=String) order is UTF-16 order -- *not* code point order.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static int compare(String string, int codePoint) {
|
||||
if (codePoint < Character.MIN_CODE_POINT || codePoint > Character.MAX_CODE_POINT) {
|
||||
@ -4304,8 +4281,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* Utility to compare a string to a code point.
|
||||
* Same results as turning the code point into a string and comparing, but much faster (no object creation).
|
||||
* Actually, there is one difference; a null compares as less.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static int compare(int codepoint, String a) {
|
||||
return -compare(a, codepoint);
|
||||
@ -4317,8 +4293,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* That means that sets can't be compared directly with this method, unless they are TreeSets without
|
||||
* (or with the same) comparator. Unfortunately, it is impossible to reliably detect in Java whether subclass of
|
||||
* Collection satisfies the right criteria, so it is left to the user to avoid those circumstances.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static <T extends Comparable<T>> int compare(Iterable<T> collection1, Iterable<T> collection2) {
|
||||
Iterator<T> first = collection1.iterator();
|
||||
@ -4340,8 +4315,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* Utility to compare two collections, optionally by size, and then lexicographically.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static <T extends Comparable<T>> int compare(Collection<T> collection1, Collection<T> collection2, ComparisonStyle style) {
|
||||
if (style != ComparisonStyle.LEXICOGRAPHIC) {
|
||||
@ -4355,8 +4329,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* Utility for adding the contents of an iterable to a collection.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static <T, U extends Collection<T>> U addAllTo(Iterable<T> source, U target) {
|
||||
for (T item : source) {
|
||||
@ -4367,8 +4340,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
|
||||
/**
|
||||
* Utility for adding the contents of an iterable to a collection.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static <T> T[] addAllTo(Iterable<T> source, T[] target) {
|
||||
int i = 0;
|
||||
@ -4385,8 +4357,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* doSomethingWith(key);
|
||||
* }
|
||||
* </pre>
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Iterable<String> strings() {
|
||||
return Collections.unmodifiableSortedSet(strings);
|
||||
@ -4520,8 +4491,7 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* Note: Unpaired surrogates are treated like surrogate code points. Similarly, set strings match only on code point
|
||||
* boundaries, never in the middle of a surrogate pair.
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public enum SpanCondition {
|
||||
/**
|
||||
@ -4531,10 +4501,10 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* When span() returns, the substring between where it started and the position it returned consists only of
|
||||
* characters that are not in the set, and none of its strings overlap with the span.
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
NOT_CONTAINED,
|
||||
|
||||
/**
|
||||
* Continue a span() while there is a set element at the current position. (For characters only, this is like
|
||||
* while contains(current)==TRUE).
|
||||
@ -4547,9 +4517,9 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* concatenation of characters or strings.) This is equivalent to a POSIX regular expression for (OR of each set
|
||||
* element)*.
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
|
||||
CONTAINED,
|
||||
/**
|
||||
* Continue a span() while there is a set element at the current position. (For characters only, this is like
|
||||
@ -4566,15 +4536,14 @@ public class UnicodeSet extends UnicodeFilter implements Iterable<String>, Compa
|
||||
* Use this span condition together with other longest-match algorithms, such as ICU converters
|
||||
* (ucnv_getUnicodeSet()).
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
|
||||
SIMPLE,
|
||||
/**
|
||||
* One more than the last span condition.
|
||||
*
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
CONDITION_COUNT
|
||||
}
|
||||
|
@ -925,8 +925,7 @@ public abstract class Calendar implements Serializable, Cloneable, Comparable<Ca
|
||||
/**
|
||||
* {@icu} Field indicating whether or not the current month is a leap month.
|
||||
* Should have a value of 0 for non-leap months, and 1 for leap months.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int IS_LEAP_MONTH = 22;
|
||||
|
||||
|
@ -40,8 +40,7 @@ import com.ibm.icu.impl.Row.R3;
|
||||
* default languages based on additional information, such as the domain.
|
||||
*
|
||||
* @author markdavis@google.com
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public class LocaleMatcher {
|
||||
private static final boolean DEBUG = false;
|
||||
@ -65,8 +64,7 @@ public class LocaleMatcher {
|
||||
* of the page.
|
||||
*
|
||||
* @param languagePriorityList weighted list
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public LocaleMatcher(LocalePriorityList languagePriorityList) {
|
||||
this(languagePriorityList, defaultWritten);
|
||||
@ -77,8 +75,7 @@ public class LocaleMatcher {
|
||||
* language is the default.
|
||||
*
|
||||
* @param languagePriorityListString String form of LanguagePriorityList
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public LocaleMatcher(String languagePriorityListString) {
|
||||
this(LocalePriorityList.add(languagePriorityListString).build());
|
||||
@ -111,8 +108,7 @@ public class LocaleMatcher {
|
||||
* @param supported Supported locale
|
||||
* @param supportedMax Maximized locale (using likely subtags)
|
||||
* @return value between 0 and 1, inclusive.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public double match(ULocale desired, ULocale desiredMax, ULocale supported, ULocale supportedMax) {
|
||||
return matcherData.match(desired, desiredMax, supported, supportedMax);
|
||||
@ -125,8 +121,7 @@ public class LocaleMatcher {
|
||||
* for likelySubtags.
|
||||
* @param ulocale language/locale code
|
||||
* @return ULocale with remapped subtags.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public ULocale canonicalize(ULocale ulocale) {
|
||||
// TODO Get the data from CLDR, use Java conventions.
|
||||
@ -151,8 +146,7 @@ public class LocaleMatcher {
|
||||
*
|
||||
* @param languageList list to match
|
||||
* @return best matching language code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public ULocale getBestMatch(LocalePriorityList languageList) {
|
||||
double bestWeight = 0;
|
||||
@ -176,8 +170,7 @@ public class LocaleMatcher {
|
||||
*
|
||||
* @param languageList String form of language priority list
|
||||
* @return best matching language code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public ULocale getBestMatch(String languageList) {
|
||||
return getBestMatch(LocalePriorityList.add(languageList).build());
|
||||
@ -188,8 +181,7 @@ public class LocaleMatcher {
|
||||
*
|
||||
* @param ulocale locale/language code to match
|
||||
* @return best matching language code
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public ULocale getBestMatch(ULocale ulocale) {
|
||||
return getBestMatchInternal(ulocale).get0();
|
||||
@ -197,8 +189,7 @@ public class LocaleMatcher {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -62,8 +62,7 @@ import java.util.regex.Pattern;
|
||||
* fr;q=1.0
|
||||
* ja;q=1.0</pre>
|
||||
* @author markdavis@google.com
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public class LocalePriorityList implements Iterable<ULocale> {
|
||||
private static final double D0 = 0.0d;
|
||||
@ -79,8 +78,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param languageCode locale/language to be added
|
||||
* @return internal builder, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static Builder add(ULocale languageCode) {
|
||||
return new Builder().add(languageCode);
|
||||
@ -92,8 +90,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
* @param languageCode locale/language to be added
|
||||
* @param weight value from 0.0 to 1.0
|
||||
* @return internal builder, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static Builder add(ULocale languageCode, final double weight) {
|
||||
return new Builder().add(languageCode, weight);
|
||||
@ -104,8 +101,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param languagePriorityList list to add all the members of
|
||||
* @return internal builder, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static Builder add(LocalePriorityList languagePriorityList) {
|
||||
return new Builder().add(languagePriorityList);
|
||||
@ -117,8 +113,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param acceptLanguageString String in rfc2616 format (but leniently parsed)
|
||||
* @return internal builder, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static Builder add(String acceptLanguageString) {
|
||||
return new Builder().add(acceptLanguageString);
|
||||
@ -130,8 +125,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param language to get weight of
|
||||
* @return weight
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Double getWeight(ULocale language) {
|
||||
return languagesAndWeights.get(language);
|
||||
@ -139,8 +133,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
@ -160,8 +153,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Iterator<ULocale> iterator() {
|
||||
return languagesAndWeights.keySet().iterator();
|
||||
@ -169,8 +161,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
@ -184,8 +175,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
@ -201,8 +191,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
|
||||
/**
|
||||
* Class used for building LanguagePriorityLists
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static class Builder {
|
||||
/**
|
||||
@ -223,8 +212,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
* {@link Builder#build(boolean) Builder.build(false)}.
|
||||
*
|
||||
* @return A LocalePriorityList
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public LocalePriorityList build() {
|
||||
return build(false);
|
||||
@ -236,8 +224,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
* @param preserveWeights when true, the weights originally came
|
||||
* from a language priority list specified by add() are preserved.
|
||||
* @return A LocalePriorityList
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public LocalePriorityList build(boolean preserveWeights) {
|
||||
// Walk through the input list, collecting the items with the same weights.
|
||||
@ -267,8 +254,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param languagePriorityList a LocalePriorityList
|
||||
* @return this, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Builder add(
|
||||
final LocalePriorityList languagePriorityList) {
|
||||
@ -284,8 +270,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param languageCode to add with weight 1.0
|
||||
* @return this, for chaining
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Builder add(final ULocale languageCode) {
|
||||
return add(languageCode, D1);
|
||||
@ -296,8 +281,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param languageCodes List of language codes.
|
||||
* @return this, for chaining.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Builder add(ULocale... languageCodes) {
|
||||
for (final ULocale languageCode : languageCodes) {
|
||||
@ -313,8 +297,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
* @param languageCode language/locale to add
|
||||
* @param weight value between 0.0 and 1.1
|
||||
* @return this, for chaining.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Builder add(final ULocale languageCode,
|
||||
double weight) {
|
||||
@ -335,8 +318,7 @@ public class LocalePriorityList implements Iterable<ULocale> {
|
||||
*
|
||||
* @param acceptLanguageList in rfc2616 format
|
||||
* @return this, for chaining.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public Builder add(final String acceptLanguageList) {
|
||||
final String[] items = languageSplitter.split(acceptLanguageList.trim());
|
||||
|
@ -155,8 +155,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a short generic name, such as "PT."
|
||||
* @see #LONG_GENERIC
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int SHORT_GENERIC = 2;
|
||||
|
||||
@ -164,8 +163,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a long generic name, such as "Pacific Time."
|
||||
* @see #SHORT_GENERIC
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int LONG_GENERIC = 3;
|
||||
|
||||
@ -173,8 +171,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a short name derived from the timezone's offset, such as "-0800."
|
||||
* @see #LONG_GMT
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int SHORT_GMT = 4;
|
||||
|
||||
@ -182,8 +179,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a long name derived from the timezone's offset, such as "GMT-08:00."
|
||||
* @see #SHORT_GMT
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int LONG_GMT = 5;
|
||||
|
||||
@ -191,8 +187,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a short name derived from the timezone's short standard or daylight
|
||||
* timezone name ignoring commonlyUsed, such as "PDT."
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
|
||||
public static final int SHORT_COMMONLY_USED = 6;
|
||||
@ -201,8 +196,7 @@ abstract public class TimeZone implements Serializable, Cloneable {
|
||||
* {@icu} A style specifier for <code>getDisplayName()</code> indicating
|
||||
* a long name derived from the timezone's fallback name, such as
|
||||
* "United States (Los Angeles)."
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static final int GENERIC_LOCATION = 7;
|
||||
|
||||
|
@ -1143,8 +1143,7 @@ public final class ULocale implements Serializable {
|
||||
* {@icu} Returns this locale's language localized for display in the default locale.
|
||||
* If a dialect name is present in the data, then it is returned.
|
||||
* @return the localized language name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String getDisplayLanguageWithDialect() {
|
||||
return getDisplayLanguageInternal(this, getDefault(), true);
|
||||
@ -1155,8 +1154,7 @@ public final class ULocale implements Serializable {
|
||||
* If a dialect name is present in the data, then it is returned.
|
||||
* @param displayLocale the locale in which to display the name.
|
||||
* @return the localized language name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String getDisplayLanguageWithDialect(ULocale displayLocale) {
|
||||
return getDisplayLanguageInternal(this, displayLocale, true);
|
||||
@ -1169,8 +1167,7 @@ public final class ULocale implements Serializable {
|
||||
* @param localeID the id of the locale whose language will be displayed
|
||||
* @param displayLocaleID the id of the locale in which to display the name.
|
||||
* @return the localized language name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String getDisplayLanguageWithDialect(String localeID, String displayLocaleID) {
|
||||
return getDisplayLanguageInternal(new ULocale(localeID), new ULocale(displayLocaleID),
|
||||
@ -1184,8 +1181,7 @@ public final class ULocale implements Serializable {
|
||||
* @param localeID the id of the locale whose language will be displayed.
|
||||
* @param displayLocale the locale in which to display the name.
|
||||
* @return the localized language name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String getDisplayLanguageWithDialect(String localeID, ULocale displayLocale) {
|
||||
return getDisplayLanguageInternal(new ULocale(localeID), displayLocale, true);
|
||||
@ -1490,8 +1486,7 @@ public final class ULocale implements Serializable {
|
||||
* {@icu} Returns this locale name localized for display in the default locale.
|
||||
* If a dialect name is present in the locale data, then it is returned.
|
||||
* @return the localized locale name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String getDisplayNameWithDialect() {
|
||||
return getDisplayNameWithDialectInternal(this, getDefault());
|
||||
@ -1502,8 +1497,7 @@ public final class ULocale implements Serializable {
|
||||
* If a dialect name is present in the locale data, then it is returned.
|
||||
* @param displayLocale the locale in which to display the locale name.
|
||||
* @return the localized locale name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public String getDisplayNameWithDialect(ULocale displayLocale) {
|
||||
return getDisplayNameWithDialectInternal(this, displayLocale);
|
||||
@ -1516,8 +1510,7 @@ public final class ULocale implements Serializable {
|
||||
* @param localeID the locale whose name is to be displayed.
|
||||
* @param displayLocaleID the id of the locale in which to display the locale name.
|
||||
* @return the localized locale name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String getDisplayNameWithDialect(String localeID, String displayLocaleID) {
|
||||
return getDisplayNameWithDialectInternal(new ULocale(localeID),
|
||||
@ -1531,8 +1524,7 @@ public final class ULocale implements Serializable {
|
||||
* @param localeID the locale whose name is to be displayed.
|
||||
* @param displayLocale the locale in which to display the locale name.
|
||||
* @return the localized locale name.
|
||||
* @draft ICU 4.4
|
||||
* @provisional This API might change or be removed in a future release.
|
||||
* @stable ICU 4.4
|
||||
*/
|
||||
public static String getDisplayNameWithDialect(String localeID, ULocale displayLocale) {
|
||||
return getDisplayNameWithDialectInternal(new ULocale(localeID), displayLocale);
|
||||
|
Loading…
Reference in New Issue
Block a user