ICU-12735 Merged ICU4J API promotion draft from the work branch to trunk, and updated the API change report with them.

X-SVN-Rev: 39312
This commit is contained in:
Yoshito Umaoka 2016-09-21 19:44:11 +00:00
parent 370abbf3b9
commit 96df443f84
5 changed files with 293 additions and 52 deletions

View file

@ -4,10 +4,10 @@
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- © 2016 and later: Unicode, Inc. and others. -->
<!-- License & terms of use: http://www.unicode.org/copyright.html#License -->
<title>ICU4J API Comparison: ICU4J 57.1 with ICU4J 58.0.1</title>
<title>ICU4J API Comparison: ICU4J 57.1 with ICU4J 58.1</title>
</head>
<body>
<h1>ICU4J API Comparison: ICU4J 57.1 with ICU4J 58.0.1</h1>
<h1>ICU4J API Comparison: ICU4J 57.1 with ICU4J 58.1</h1>
<hr/>
<h2>Removed from ICU4J 57.1</h2>
@ -22,19 +22,172 @@ ChineseDateFormatSymbols
<hr/>
<h2>Deprecated or Obsoleted in ICU4J 58.0.1</h2>
<p>(no API obsoleted)</p>
<h2>Deprecated or Obsoleted in ICU4J 58.1</h2>
<h3>Package com.ibm.icu.lang</h3>
<ul>
UCharacter.BidiPairedBracketType
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.DecompositionType
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.EastAsianWidth
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.GraphemeClusterBreak
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.HangulSyllableType
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.JoiningGroup
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.JoiningType
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.LineBreak
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.NumericType
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.SentenceBreak
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.UnicodeBlock
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacter.WordBreak
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UCharacterEnums.ECharacterDirection
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int CHAR_DIRECTION_COUNT</li>
</ul>
UProperty
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int BINARY_LIMIT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int DOUBLE_LIMIT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int INT_LIMIT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int MASK_LIMIT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int OTHER_PROPERTY_LIMIT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int STRING_LIMIT</li>
</ul>
UProperty.NameChoice
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
UScript
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int CODE_LIMIT</li>
</ul>
</ul>
<h3>Package com.ibm.icu.text</h3>
<ul>
Bidi
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int CLASS_DEFAULT</li>
</ul>
CollationKey.BoundMode
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int COUNT</li>
</ul>
Collator.ReorderCodes
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int LIMIT</li>
</ul>
DateFormat
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int FIELD_COUNT</li>
</ul>
DateTimePatternGenerator
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int TYPE_LIMIT</li>
</ul>
SpoofChecker
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int ANY_CASE</li>
<li><span style='color:gray'>(deprecated)</span> public java.lang.String <i>getSkeleton</i>(int, java.lang.String)</li>
</ul>
SpoofChecker.Builder
<ul>
<li><span style='color:gray'>(deprecated)</span> public SpoofChecker.Builder <i>setData</i>(java.io.Reader, java.io.Reader)</li>
</ul>
</ul>
<h3>Package com.ibm.icu.util</h3>
<ul>
Calendar
<ul>
<li><span style='color:gray'>(deprecated)</span> protected static final int BASE_FIELD_COUNT</li>
<li><span style='color:gray'>(deprecated)</span> protected static final int MAX_FIELD_COUNT</li>
</ul>
LocaleData
<ul>
<li><span style='color:gray'>(deprecated)</span> public static final int DELIMITER_COUNT</li>
<li><span style='color:gray'>(deprecated)</span> public static final int ES_COUNT</li>
</ul>
</ul>
<hr/>
<h2>Changed in ICU4J 58.0.1 (old, new)</h2>
<h2>Changed in ICU4J 58.1 (old, new)</h2>
<p>(no API changed)</p>
<hr/>
<h2>Promoted to stable in ICU4J 58.0.1</h2>
<p>(no API promoted to stable)</p>
<h2>Promoted to stable in ICU4J 58.1</h2>
<h3>Package com.ibm.icu.text</h3>
<ul>
DateFormat.BooleanAttribute
<ul>
<li><span style='color:green'>(stable)</span> public static final DateFormat.BooleanAttribute PARSE_MULTIPLE_PATTERNS_FOR_MATCH</li>
<li><span style='color:green'>(stable)</span> public static final DateFormat.BooleanAttribute PARSE_PARTIAL_LITERAL_MATCH</li>
</ul>
NumberFormat
<ul>
<li><span style='color:green'>(stable)</span> public static final int STANDARDCURRENCYSTYLE</li>
</ul>
RuleBasedNumberFormat
<ul>
<li><span style='color:green'>(stable)</span> public int <i>getRoundingMode</i>()</li>
<li><span style='color:green'>(stable)</span> public void <i>setRoundingMode</i>(int)</li>
</ul>
</ul>
<h3>Package com.ibm.icu.util</h3>
<ul>
MeasureUnit
<ul>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit CENTURY</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit CUP_METRIC</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit GENERIC_TEMPERATURE</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit KNOT</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit LITER_PER_100KILOMETERS</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit MILE_SCANDINAVIAN</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit PINT_METRIC</li>
<li><span style='color:green'>(stable)</span> public static final MeasureUnit REVOLUTION_ANGLE</li>
</ul>
</ul>
<hr/>
<h2>Added in ICU4J 58.0.1</h2>
<h2>Added in ICU4J 58.1</h2>
<h3>Package com.ibm.icu.lang</h3>
<ul>
@ -106,14 +259,89 @@ UScript
<h3>Package com.ibm.icu.text</h3>
<ul>
<li><span style='color:orange'>(draft)</span> public class <i>BidiTransform</i></li>
<li><span style='color:orange'>(draft)</span> public static enum <i>BidiTransform.Mirroring</i></li>
<li><span style='color:orange'>(draft)</span> public static enum <i>BidiTransform.Order</i></li>
BidiTransform.Mirroring
<ul>
<li><span style='color:orange'>(draft)</span> public static final BidiTransform.Mirroring OFF</li>
<li><span style='color:orange'>(draft)</span> public static final BidiTransform.Mirroring ON</li>
</ul>
BidiTransform.Order
<ul>
<li><span style='color:orange'>(draft)</span> public static final BidiTransform.Order LOGICAL</li>
<li><span style='color:orange'>(draft)</span> public static final BidiTransform.Order VISUAL</li>
</ul>
ChineseDateFormatSymbols
<ul>
<li><span style='color:gray'>(deprecated)</span> protected void <i>initializeData</i>(ULocale, ICUResourceBundle, java.lang.String)</li>
</ul>
DecimalFormatSymbols
<ul>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getDecimalSeparatorString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String[] <i>getDigitStrings</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getGroupingSeparatorString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getMinusSignString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getMonetaryDecimalSeparatorString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getMonetaryGroupingSeparatorString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getPerMillString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getPercentString</i>()</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getPlusSignString</i>()</li>
<li><span style='color:orange'>(draft)</span> public void <i>setDecimalSeparatorString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setDigitStrings</i>(java.lang.String[])</li>
<li><span style='color:orange'>(draft)</span> public void <i>setGroupingSeparatorString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setMinusSignString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setMonetaryDecimalSeparatorString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setMonetaryGroupingSeparatorString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setPerMillString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setPercentString</i>(java.lang.String)</li>
<li><span style='color:orange'>(draft)</span> public void <i>setPlusSignString</i>(java.lang.String)</li>
</ul>
DisplayContext
<ul>
<li><span style='color:orange'>(draft)</span> public static final DisplayContext NO_SUBSTITUTE</li>
<li><span style='color:orange'>(draft)</span> public static final DisplayContext SUBSTITUTE</li>
</ul>
DisplayContext.Type
<ul>
<li><span style='color:orange'>(draft)</span> public static final DisplayContext.Type SUBSTITUTE_HANDLING</li>
</ul>
MeasureFormat
<ul>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getUnitDisplayName</i>(MeasureUnit)</li>
</ul>
SpoofChecker
<ul>
<li><span style='color:orange'>(draft)</span> public static final int CONFUSABLE</li>
<li><span style='color:orange'>(draft)</span> public static final UnicodeSet INCLUSION</li>
<li><span style='color:orange'>(draft)</span> public static final int MIXED_NUMBERS</li>
<li><span style='color:orange'>(draft)</span> public static final UnicodeSet RECOMMENDED</li>
<li><span style='color:orange'>(draft)</span> public static final int RESTRICTION_LEVEL</li>
<li><span style='color:orange'>(draft)</span> public boolean <i>equals</i>(java.lang.Object)</li>
<li><span style='color:orange'>(draft)</span> public java.lang.String <i>getSkeleton</i>(java.lang.CharSequence)</li>
<li><span style='color:orange'>(draft)</span> public int <i>hashCode</i>()</li>
</ul>
SpoofChecker.Builder
<ul>
<li><span style='color:orange'>(draft)</span> public SpoofChecker.Builder <i>setData</i>(java.io.Reader)</li>
<li><span style='color:orange'>(draft)</span> public SpoofChecker.Builder <i>setRestrictionLevel</i>(SpoofChecker.RestrictionLevel)</li>
</ul>
SpoofChecker.CheckResult
<ul>
<li><span style='color:orange'>(draft)</span> public UnicodeSet numerics</li>
<li><span style='color:orange'>(draft)</span> public SpoofChecker.RestrictionLevel restrictionLevel</li>
</ul>
</ul>
<h3>Package com.ibm.icu.util</h3>
<ul>
MeasureUnit
<ul>
<li><span style='color:orange'>(draft)</span> public static final MeasureUnit EAST</li>
<li><span style='color:orange'>(draft)</span> public static final MeasureUnit NORTH</li>
<li><span style='color:orange'>(draft)</span> public static final MeasureUnit SOUTH</li>
<li><span style='color:orange'>(draft)</span> public static final MeasureUnit WEST</li>
</ul>
VersionInfo
<ul>
<li><span style='color:green'>(stable)</span> public static final VersionInfo UNICODE_9_0</li>
@ -121,6 +349,6 @@ VersionInfo
</ul>
<hr/>
<p><i><font size="-1">Contents generated by ReportAPI tool on Wed Jun 29 12:47:00 EDT 2016<br/>© 2016 and later: Unicode, Inc. and others. License & terms of use: <a href="http://www.unicode.org/copyright.html#License">http://www.unicode.org/copyright.html#License</a></font></i></p>
<p><i><font size="-1">Contents generated by ReportAPI tool on Wed Sep 21 15:35:29 EDT 2016<br/>© 2016 and later: Unicode, Inc. and others. License & terms of use: <a href="http://www.unicode.org/copyright.html#License">http://www.unicode.org/copyright.html#License</a></font></i></p>
</body>
</html>

View file

@ -514,15 +514,13 @@ public abstract class DateFormat extends UFormat {
/**
* indicates tolerance of pattern mismatch between input data and specified format pattern.
* e.g. accepting "September" for a month pattern of MMM ("Sep")
* @draft ICU 56
* @provisional This API might change or be removed in a future release.
* @stable ICU 56
*/
PARSE_MULTIPLE_PATTERNS_FOR_MATCH,
/**
* indicates tolerance of a partial literal match
* e.g. accepting "--mon-02-march-2011" for a pattern of "'--: 'EEE-WW-MMMM-yyyy"
* @draft ICU 56
* @provisional This API might change or be removed in a future release.
* @stable ICU 56
*/
PARSE_PARTIAL_LITERAL_MATCH,
/**

View file

@ -231,8 +231,7 @@ public abstract class NumberFormat extends UFormat {
* to represent currency, for example "$3.00", using non-accounting style for
* negative values (e.g. minus sign).
* Overrides any style specified using -cf- key in locale.
* @draft ICU 56
* @provisional This API might change or be removed in a future release.
* @stable ICU 56
*/
public static final int STANDARDCURRENCYSTYLE = 9;

View file

@ -896,6 +896,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @return A RuleBasedNumberFormat that is equal to this one.
* @stable ICU 2.0
*/
@Override
public Object clone() {
return super.clone();
}
@ -906,6 +907,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @return true if the two formatters have identical behavior.
* @stable ICU 2.0
*/
@Override
public boolean equals(Object that) {
// if the other object isn't a RuleBasedNumberFormat, that's
// all we need to know
@ -937,13 +939,14 @@ public class RuleBasedNumberFormat extends NumberFormat {
return true;
}
}
/**
* Mock implementation of hashCode(). This implementation always returns a constant
* value. When Java assertion is enabled, this method triggers an assertion failure.
* @internal
* @deprecated This API is ICU internal only.
*/
@Override
@Deprecated
public int hashCode() {
return super.hashCode();
@ -957,6 +960,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* the same result.
* @stable ICU 2.0
*/
@Override
public String toString() {
// accumulate the descriptions of all the rule sets in a
@ -1178,6 +1182,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @return toAppendTo
* @stable ICU 2.0
*/
@Override
public StringBuffer format(double number,
StringBuffer toAppendTo,
FieldPosition ignore) {
@ -1207,6 +1212,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @return toAppendTo
* @stable ICU 2.0
*/
@Override
public StringBuffer format(long number,
StringBuffer toAppendTo,
FieldPosition ignore) {
@ -1228,6 +1234,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* Format a BigInteger.
* @stable ICU 2.0
*/
@Override
public StringBuffer format(BigInteger number,
StringBuffer toAppendTo,
FieldPosition pos) {
@ -1240,6 +1247,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* Format a BigDecimal.
* @stable ICU 2.0
*/
@Override
public StringBuffer format(java.math.BigDecimal number,
StringBuffer toAppendTo,
FieldPosition pos) {
@ -1255,6 +1263,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* Format a BigDecimal.
* @stable ICU 2.0
*/
@Override
public StringBuffer format(com.ibm.icu.math.BigDecimal number,
StringBuffer toAppendTo,
FieldPosition pos) {
@ -1285,6 +1294,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @see #setLenientParseMode
* @stable ICU 2.0
*/
@Override
public Number parse(String text, ParsePosition parsePosition) {
// parsePosition tells us where to start parsing. We copy the
@ -1373,7 +1383,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
}
/**
* Sets the provider for the lenient scanner. If this has not been set,
* Sets the provider for the lenient scanner. If this has not been set,
* {@link #setLenientParseMode}
* has no effect. This is necessary to decouple collation from format code.
* @param scannerProvider the provider
@ -1463,11 +1473,11 @@ public class RuleBasedNumberFormat extends NumberFormat {
}
return "";
}
/**
* Sets the decimal format symbols used by this formatter. The formatter uses a copy of the
* provided symbols.
*
*
* @param newSymbols desired DecimalFormatSymbols
* @see DecimalFormatSymbols
* @stable ICU 49
@ -1496,14 +1506,15 @@ public class RuleBasedNumberFormat extends NumberFormat {
/**
* {@icu} Set a particular DisplayContext value in the formatter,
* such as CAPITALIZATION_FOR_STANDALONE. Note: For getContext, see
* such as CAPITALIZATION_FOR_STANDALONE. Note: For getContext, see
* NumberFormat.
*
* @param context The DisplayContext value to set.
*
* @param context The DisplayContext value to set.
* @stable ICU 53
*/
// Here we override the NumberFormat implementation in order to
// lazily initialize relevant items
// lazily initialize relevant items
@Override
public void setContext(DisplayContext context) {
super.setContext(context);
if (!capitalizationInfoIsSet &&
@ -1525,7 +1536,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* <code>BigDecimal.ROUND_UNNECESSARY</code>.
* @see #setRoundingMode
* @see java.math.BigDecimal
* @draft ICU 56
* @stable ICU 56
*/
@Override
public int getRoundingMode() {
@ -1541,7 +1552,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
* @exception IllegalArgumentException if <code>roundingMode</code> is unrecognized.
* @see #getRoundingMode
* @see java.math.BigDecimal
* @draft ICU 56
* @stable ICU 56
*/
@Override
public void setRoundingMode(int roundingMode) {
@ -1853,7 +1864,7 @@ public class RuleBasedNumberFormat extends NumberFormat {
}
/**
* Set capitalizationForListOrMenu, capitalizationForStandAlone
* Set capitalizationForListOrMenu, capitalizationForStandAlone
*/
private void initCapitalizationContextInfo(ULocale theLocale) {
ICUResourceBundle rb = (ICUResourceBundle) UResourceBundle.getBundleInstance(ICUData.ICU_BASE_NAME, theLocale);

View file

@ -38,11 +38,11 @@ import com.ibm.icu.text.UnicodeSet;
*/
public class MeasureUnit implements Serializable {
private static final long serialVersionUID = -1839973855554750484L;
// Cache of MeasureUnits.
// All access to the cache or cacheIsPopulated flag must be synchronized on class MeasureUnit,
// i.e. from synchronized static methods. Beware of non-static methods.
private static final Map<String, Map<String,MeasureUnit>> cache
private static final Map<String, Map<String,MeasureUnit>> cache
= new HashMap<String, Map<String,MeasureUnit>>();
private static boolean cacheIsPopulated = false;
@ -52,14 +52,14 @@ public class MeasureUnit implements Serializable {
*/
@Deprecated
protected final String type;
/**
* @internal
* @deprecated This API is ICU internal only.
*/
@Deprecated
protected final String subType;
/**
* @internal
* @deprecated This API is ICU internal only.
@ -69,16 +69,16 @@ public class MeasureUnit implements Serializable {
this.type = type;
this.subType = subType;
}
/**
* Get the type, such as "length"
*
*
* @stable ICU 53
*/
public String getType() {
return type;
}
/**
* Get the subType, such as foot.
@ -88,22 +88,22 @@ public class MeasureUnit implements Serializable {
public String getSubtype() {
return subType;
}
/**
* {@inheritDoc}
*
*
* @stable ICU 53
*/
@Override
public int hashCode() {
return 31 * type.hashCode() + subType.hashCode();
}
/**
* {@inheritDoc}
*
*
* @stable ICU 53
*/
@Override
@ -117,24 +117,24 @@ public class MeasureUnit implements Serializable {
MeasureUnit c = (MeasureUnit) rhs;
return type.equals(c.type) && subType.equals(c.subType);
}
/**
* {@inheritDoc}
*
*
* @stable ICU 53
*/
@Override
public String toString() {
return type + "-" + subType;
}
/**
* Get all of the available units' types. Returned set is unmodifiable.
*
*
* @stable ICU 53
*/
public synchronized static Set<String> getAvailableTypes() {
populateCache();
populateCache();
return Collections.unmodifiableSet(cache.keySet());
}
@ -145,7 +145,7 @@ public class MeasureUnit implements Serializable {
* @stable ICU 53
*/
public synchronized static Set<MeasureUnit> getAvailable(String type) {
populateCache();
populateCache();
Map<String, MeasureUnit> units = cache.get(type);
// Train users not to modify returned set from the start giving us more
// flexibility for implementation.
@ -200,7 +200,7 @@ public class MeasureUnit implements Serializable {
}
return MeasureUnit.addUnit(type, subType, factory);
}
/**
* For ICU use only.
* @internal
@ -229,18 +229,21 @@ public class MeasureUnit implements Serializable {
}
private static Factory UNIT_FACTORY = new Factory() {
@Override
public MeasureUnit create(String type, String subType) {
return new MeasureUnit(type, subType);
}
};
static Factory CURRENCY_FACTORY = new Factory() {
@Override
public MeasureUnit create(String unusedType, String subType) {
return new Currency(subType);
}
};
static Factory TIMEUNIT_FACTORY = new Factory() {
@Override
public MeasureUnit create(String type, String subType) {
return new TimeUnit(type, subType);
}
@ -288,12 +291,12 @@ public class MeasureUnit implements Serializable {
* or other API that expects to see all of the MeasureUnits.
*
* <p>At static initialization time the MeasureUnits cache is populated
* with public static instances (G_FORCE, METER_PER_SECOND_SQUARED, etc.) only.
* Adding of others is deferred until later to avoid circular static init
* with public static instances (G_FORCE, METER_PER_SECOND_SQUARED, etc.) only.
* Adding of others is deferred until later to avoid circular static init
* dependencies with classes Currency and TimeUnit.
*
* <p>Synchronization: this function must be called from static synchronized methods only.
*
*
* @internal
*/
static private void populateCache() {
@ -337,7 +340,7 @@ public class MeasureUnit implements Serializable {
cache.put(type, tmp = new HashMap<String, MeasureUnit>());
} else {
// "intern" the type by setting to first item's type.
type = tmp.entrySet().iterator().next().getValue().type;
type = tmp.entrySet().iterator().next().getValue().type;
}
MeasureUnit unit = tmp.get(unitName);
if (unit == null) {
@ -350,7 +353,7 @@ public class MeasureUnit implements Serializable {
/*
* Useful constants. Not necessarily complete: see {@link #getAvailable()}.
*/
// All code between the "Start generated MeasureUnit constants" comment and
// the "End generated MeasureUnit constants" comment is auto generated code
// and must not be edited manually. For instructions on how to correctly
@ -358,7 +361,7 @@ public class MeasureUnit implements Serializable {
// http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit
//
// Start generated MeasureUnit constants
/**
* Constant for unit of acceleration: g-force
* @stable ICU 53
@ -1232,6 +1235,7 @@ public class MeasureUnit implements Serializable {
public MeasureUnitProxy() {
}
@Override
public void writeExternal(ObjectOutput out) throws IOException {
out.writeByte(0); // version
out.writeUTF(type);
@ -1239,6 +1243,7 @@ public class MeasureUnit implements Serializable {
out.writeShort(0); // allow for more data.
}
@Override
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException {
/* byte version = */ in.readByte(); // version
type = in.readUTF();