ICU-9604 CompactDecimalFormat.getCompactDecimalInstance -> CompactDecimalFormat.getInstance
X-SVN-Rev: 32443
This commit is contained in:
parent
9cd81237ef
commit
24123a1ac0
@ -91,7 +91,7 @@ public class CompactDecimalFormat extends DecimalFormat {
|
|||||||
* @draft ICU 50
|
* @draft ICU 50
|
||||||
* @provisional This API might change or be removed in a future release.
|
* @provisional This API might change or be removed in a future release.
|
||||||
*/
|
*/
|
||||||
public static CompactDecimalFormat getCompactDecimalInstance(ULocale locale, CompactStyle style) {
|
public static CompactDecimalFormat getInstance(ULocale locale, CompactStyle style) {
|
||||||
return new CompactDecimalFormat(locale, style);
|
return new CompactDecimalFormat(locale, style);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,12 +104,12 @@ public class CompactDecimalFormat extends DecimalFormat {
|
|||||||
* @draft ICU 50
|
* @draft ICU 50
|
||||||
* @provisional This API might change or be removed in a future release.
|
* @provisional This API might change or be removed in a future release.
|
||||||
*/
|
*/
|
||||||
public static CompactDecimalFormat getCompactDecimalInstance(Locale locale, CompactStyle style) {
|
public static CompactDecimalFormat getInstance(Locale locale, CompactStyle style) {
|
||||||
return new CompactDecimalFormat(ULocale.forLocale(locale), style);
|
return new CompactDecimalFormat(ULocale.forLocale(locale), style);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The public mechanism is NumberFormat.getCompactDecimalInstance().
|
* The public mechanism is CompactDecimalFormat.getInstance().
|
||||||
*
|
*
|
||||||
* @param locale
|
* @param locale
|
||||||
* the desired locale
|
* the desired locale
|
||||||
|
@ -110,7 +110,7 @@ public class CompactDecimalFormatTest extends TestFmwk {
|
|||||||
|
|
||||||
public void TestCharacterIterator() {
|
public void TestCharacterIterator() {
|
||||||
CompactDecimalFormat cdf =
|
CompactDecimalFormat cdf =
|
||||||
CompactDecimalFormat.getCompactDecimalInstance(ULocale.ENGLISH, CompactStyle.SHORT);
|
CompactDecimalFormat.getInstance(ULocale.ENGLISH, CompactStyle.SHORT);
|
||||||
AttributedCharacterIterator iter = cdf.formatToCharacterIterator(12346);
|
AttributedCharacterIterator iter = cdf.formatToCharacterIterator(12346);
|
||||||
assertEquals("CharacterIterator", "12K", iterToString(iter));
|
assertEquals("CharacterIterator", "12K", iterToString(iter));
|
||||||
iter = cdf.formatToCharacterIterator(12346);
|
iter = cdf.formatToCharacterIterator(12346);
|
||||||
@ -125,7 +125,7 @@ public class CompactDecimalFormatTest extends TestFmwk {
|
|||||||
|
|
||||||
public void TestArabicLongStyle() {
|
public void TestArabicLongStyle() {
|
||||||
NumberFormat cdf =
|
NumberFormat cdf =
|
||||||
CompactDecimalFormat.getCompactDecimalInstance(
|
CompactDecimalFormat.getInstance(
|
||||||
ULocale.forLanguageTag("ar"), CompactStyle.LONG);
|
ULocale.forLanguageTag("ar"), CompactStyle.LONG);
|
||||||
assertEquals("Arabic Long", "٥٫٣ ألف", cdf.format(5300));
|
assertEquals("Arabic Long", "٥٫٣ ألف", cdf.format(5300));
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ public class CompactDecimalFormatTest extends TestFmwk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void checkLocale(ULocale locale, CompactStyle style, Object[][] testData) {
|
public void checkLocale(ULocale locale, CompactStyle style, Object[][] testData) {
|
||||||
CompactDecimalFormat cdf = CompactDecimalFormat.getCompactDecimalInstance(locale, style);
|
CompactDecimalFormat cdf = CompactDecimalFormat.getInstance(locale, style);
|
||||||
for (Object[] row : testData) {
|
for (Object[] row : testData) {
|
||||||
assertEquals(locale + " (" + locale.getDisplayName(locale) + ")", row[1], cdf.format(row[0]));
|
assertEquals(locale + " (" + locale.getDisplayName(locale) + ")", row[1], cdf.format(row[0]));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user