- Changes Java DecimalFormat boolean get* methods to is*.
- Makes the new draft methods non-virtual.
- Removes obsolete template class in header file.
- Adds proper U_HIDE tags in unum.h and decimfmt.h
}
}
-/**
- * \cond
- * explicit template instantiation. see digitlst.h
- * (When building DLLs for Windows this is required.)
- */
-#if U_PF_WINDOWS <= U_PLATFORM && U_PLATFORM <= U_PF_CYGWIN && !defined(U_IN_DOXYGEN)
-template class U_I18N_API EnumSet<UNumberFormatAttribute,
- UNUM_MAX_NONBOOLEAN_ATTRIBUTE+1,
- UNUM_LIMIT_BOOLEAN_ATTRIBUTE>;
-#endif
-/** \endcond */
-
/**
* **IMPORTANT:** New users are strongly encouraged to see if
* numberformatter.h fits their use case. Although not deprecated, this header
*/
virtual void setNegativeSuffix(const UnicodeString& newValue);
-#ifndef U_HIDE_INTERNAL_API
+#ifndef U_HIDE_DRAFT_API
/**
* Whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
- * @internal Technical Preview
+ *
+ * For more control over sign display, use NumberFormatter.
+ *
+ * @return Whether the sign is shown on positive numbers and zero.
+ * @draft ICU 64
*/
UBool isSignAlwaysShown() const;
-#endif /* U_HIDE_INTERNAL_API */
/**
- * Set whether to show the plus sign on positive (non-negative) numbers; for example, "+12"
- * @param value The new setting for whether to show plus sign on positive numbers
- * @internal Technical Preview
+ * Set whether to show the plus sign on positive (non-negative) numbers; for example, "+12".
+ *
+ * For more control over sign display, use NumberFormatter.
+ *
+ * @param value true to always show a sign; false to hide the sign on positive numbers and zero.
+ * @draft ICU 64
*/
- virtual void setSignAlwaysShown(UBool value);
+ void setSignAlwaysShown(UBool value);
+#endif /* U_HIDE_DRAFT_API */
/**
* Get the multiplier for use in percent, permill, etc.
* @draft ICU 62
*/
int32_t getMultiplierScale(void) const;
-#endif /* U_HIDE_DRAFT_API */
/**
* Sets a power of ten by which number should be multiplied before formatting, which
* @param newValue the new value of the power-of-ten multiplier.
* @draft ICU 62
*/
- virtual void setMultiplierScale(int32_t newValue);
+ void setMultiplierScale(int32_t newValue);
+#endif /* U_HIDE_DRAFT_API */
/**
* Get the rounding increment.
*/
virtual void setSecondaryGroupingSize(int32_t newValue);
-#ifndef U_HIDE_INTERNAL_API
-
+#ifndef U_HIDE_DRAFT_API
/**
* Returns the minimum number of grouping digits.
* Grouping separators are output if there are at least this many
* For example, if this value is 2, and the grouping size is 3, then
* 9999 -> "9999" and 10000 -> "10,000"
*
- * This is a technology preview. This API may change behavior or may be removed.
- *
* The default value for this attribute is 0.
* A value of 1, 0, or lower, means that the use of grouping separators
* only depends on the grouping size (and on isGroupingUsed()).
- * Currently, the corresponding CLDR data is not used; this is likely to change.
+ *
+ * NOTE: The CLDR data is used in NumberFormatter but not in DecimalFormat.
+ * This is for backwards compatibility reasons.
+ *
+ * For more control over grouping strategies, use NumberFormatter.
*
* @see setMinimumGroupingDigits
* @see getGroupingSize
- * @internal technology preview
+ * @draft ICU 64
*/
int32_t getMinimumGroupingDigits() const;
-#endif /* U_HIDE_INTERNAL_API */
-
- /* Cannot use #ifndef U_HIDE_INTERNAL_API for the following draft method since it is virtual. */
/**
* Sets the minimum grouping digits. Setting to a value less than or
* equal to 1 turns off minimum grouping digits.
*
+ * For more control over grouping strategies, use NumberFormatter.
+ *
* @param newValue the new value of minimum grouping digits.
* @see getMinimumGroupingDigits
- * @internal technology preview
+ * @draft ICU 64
*/
- virtual void setMinimumGroupingDigits(int32_t newValue);
+ void setMinimumGroupingDigits(int32_t newValue);
+#endif /* U_HIDE_DRAFT_API */
/**
*/
virtual void setDecimalPatternMatchRequired(UBool newValue);
+#ifndef U_HIDE_DRAFT_API
/**
* Returns whether to ignore exponents when parsing.
*
+ * @return Whether to ignore exponents when parsing.
* @see #setParseNoExponent
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
*/
- virtual UBool isParseNoExponent() const;
+ UBool isParseNoExponent() const;
/**
* Specifies whether to stop parsing when an exponent separator is encountered. For
* 5).
*
* @param value true to prevent exponents from being parsed; false to allow them to be parsed.
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
*/
- virtual void setParseNoExponent(UBool value);
+ void setParseNoExponent(UBool value);
/**
* Returns whether parsing is sensitive to case (lowercase/uppercase).
*
+ * @return Whether parsing is case-sensitive.
* @see #setParseCaseSensitive
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
*/
- virtual UBool isParseCaseSensitive() const;
+ UBool isParseCaseSensitive() const;
/**
* Whether to pay attention to case when parsing; default is to ignore case (perform
* Currency symbols are never case-folded. For example, "us$1.00" will not parse in case-insensitive
* mode, even though "US$1.00" parses.
*
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @param value true to enable case-sensitive parsing (the default); false to force
+ * case-sensitive parsing behavior.
+ * @draft ICU 64
*/
- virtual void setParseCaseSensitive(UBool value);
+ void setParseCaseSensitive(UBool value);
/**
* Returns whether truncation of high-order integer digits should result in an error.
* By default, setMaximumIntegerDigits truncates high-order digits silently.
*
+ * @return Whether an error code is set if high-order digits are truncated.
* @see setFormatFailIfMoreThanMaxDigits
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
*/
- virtual UBool isFormatFailIfMoreThanMaxDigits() const;
+ UBool isFormatFailIfMoreThanMaxDigits() const;
/**
* Sets whether truncation of high-order integer digits should result in an error.
* By default, setMaximumIntegerDigits truncates high-order digits silently.
*
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * @param value Whether to set an error code if high-order digits are truncated.
+ * @draft ICU 64
*/
- virtual void setFormatFailIfMoreThanMaxDigits(UBool value);
+ void setFormatFailIfMoreThanMaxDigits(UBool value);
+#endif /* U_HIDE_DRAFT_API */
/**
*
* @stable ICU 51 */
UNUM_SCALE = 21,
-#ifndef U_HIDE_INTERNAL_API
+
+#ifndef U_HIDE_DRAFT_API
/**
- * Minimum grouping digits, technology preview.
+ * Minimum grouping digits; most commonly set to 2 to print "1000" instead of "1,000".
* See DecimalFormat::getMinimumGroupingDigits().
*
- * @internal technology preview
+ * For better control over grouping strategies, use UNumberFormatter.
+ *
+ * @draft ICU 64
*/
UNUM_MINIMUM_GROUPING_DIGITS = 22,
- /* TODO: test C API when it becomes @draft */
-#endif /* U_HIDE_INTERNAL_API */
+#endif /* U_HIDE_DRAFT_API */
/**
* if this attribute is set to 0, it is set to UNUM_CURRENCY_STANDARD purpose,
*/
UNUM_CURRENCY_USAGE = 23,
- /* The following cannot be #ifndef U_HIDE_INTERNAL_API, needed in .h file variable declararions */
+#ifndef U_HIDE_INTERNAL_API
/** One below the first bitfield-boolean item.
* All items after this one are stored in boolean form.
* @internal */
UNUM_MAX_NONBOOLEAN_ATTRIBUTE = 0x0FFF,
+#endif /* U_HIDE_INTERNAL_API */
/** If 1, specifies that if setting the "max integer digits" attribute would truncate a value, set an error status rather than silently truncating.
* For example, formatting the value 1234 with 4 max int digits would succeed, but formatting 12345 would fail. There is no effect on parsing.
*/
UNUM_PARSE_DECIMAL_MARK_REQUIRED = 0x1002,
- /* The following cannot be #ifndef U_HIDE_INTERNAL_API, needed in .h file variable declararions */
- /** Limit of boolean attributes.
- * @internal */
- UNUM_LIMIT_BOOLEAN_ATTRIBUTE = 0x1003,
+#ifndef U_HIDE_DRAFT_API
/**
- * Whether parsing is sensitive to case (lowercase/uppercase).
- * TODO: Add to the test suite.
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * Parsing: if set to 1, parsing is sensitive to case (lowercase/uppercase).
+ *
+ * @draft ICU 64
*/
- UNUM_PARSE_CASE_SENSITIVE = 0x1004,
+ UNUM_PARSE_CASE_SENSITIVE = 0x1003,
/**
- * Formatting: whether to show the plus sign on non-negative numbers.
- * TODO: Add to the test suite.
- * @internal This API is a technical preview. It may change in an upcoming release.
+ * Formatting: if set to 1, whether to show the plus sign on non-negative numbers.
+ *
+ * For better control over sign display, use UNumberFormatter.
+ *
+ * @draft ICU 64
*/
- UNUM_SIGN_ALWAYS_SHOWN = 0x1005,
+ UNUM_SIGN_ALWAYS_SHOWN = 0x1004,
+
+ /** Limit of boolean attributes.
+ * @internal */
+ UNUM_LIMIT_BOOLEAN_ATTRIBUTE = 0x1005,
+
+#else /* U_HIDE_DRAFT_API */
+#ifndef U_HIDE_INTERNAL_API
+
+ /** Limit of boolean attributes.
+ * @internal */
+ UNUM_LIMIT_BOOLEAN_ATTRIBUTE = 0x1003,
+
+#endif /* U_HIDE_INTERNAL_API */
+#endif /* U_HIDE_DRAFT_API */
+
} UNumberFormatAttribute;
/**
static void TestParseCurrency(void);
static void TestMaxInt(void);
static void TestNoExponent(void);
+static void TestSignAlwaysShown(void);
+static void TestMinimumGroupingDigits(void);
+static void TestParseCaseSensitive(void);
static void TestUFormattable(void);
static void TestUNumberingSystem(void);
static void TestCurrencyIsoPluralFormat(void);
TESTCASE(TestCloneWithRBNF);
TESTCASE(TestMaxInt);
TESTCASE(TestNoExponent);
+ TESTCASE(TestSignAlwaysShown);
+ TESTCASE(TestMinimumGroupingDigits);
+ TESTCASE(TestParseCaseSensitive);
TESTCASE(TestUFormattable);
TESTCASE(TestUNumberingSystem);
TESTCASE(TestCurrencyIsoPluralFormat);
unum_close(fmt);
}
+static void TestSignAlwaysShown(void) {
+ UErrorCode status = U_ZERO_ERROR;
+ UNumberFormat *fmt = unum_open(
+ UNUM_DECIMAL, /* style */
+ NULL, /* pattern */
+ 0, /* patternLength */
+ "en-US",
+ NULL, /* parseErr */
+ &status);
+ assertSuccess("Creating UNumberFormat", &status);
+ unum_setAttribute(fmt, UNUM_SIGN_ALWAYS_SHOWN, 1);
+ UChar result[100];
+ unum_formatDouble(fmt, 42, result, 100, NULL, &status);
+ assertSuccess("Formatting with UNumberFormat", &status);
+ assertUEquals("Result with sign always shown", u"+42", result);
+ unum_close(fmt);
+}
+
+static void TestMinimumGroupingDigits(void) {
+ UErrorCode status = U_ZERO_ERROR;
+ UNumberFormat *fmt = unum_open(
+ UNUM_DECIMAL, /* style */
+ NULL, /* pattern */
+ 0, /* patternLength */
+ "en-US",
+ NULL, /* parseErr */
+ &status);
+ assertSuccess("Creating UNumberFormat", &status);
+ unum_setAttribute(fmt, UNUM_MINIMUM_GROUPING_DIGITS, 2);
+ UChar result[100];
+ unum_formatDouble(fmt, 1234, result, 100, NULL, &status);
+ assertSuccess("Formatting with UNumberFormat A", &status);
+ assertUEquals("Result with minimum grouping digits A", u"1234", result);
+ unum_formatDouble(fmt, 12345, result, 100, NULL, &status);
+ assertSuccess("Formatting with UNumberFormat B", &status);
+ assertUEquals("Result with minimum grouping digits B", u"12,345", result);
+ unum_close(fmt);
+}
+
+static void TestParseCaseSensitive(void) {
+ UErrorCode status = U_ZERO_ERROR;
+ UNumberFormat *fmt = unum_open(
+ UNUM_DECIMAL, /* style */
+ NULL, /* pattern */
+ 0, /* patternLength */
+ "en-US",
+ NULL, /* parseErr */
+ &status);
+ assertSuccess("Creating UNumberFormat", &status);
+ double result = unum_parseDouble(fmt, u"1e2", -1, NULL, &status);
+ assertSuccess("Parsing with UNumberFormat, case insensitive", &status);
+ assertIntEquals("Result with case sensitive", 100, result);
+ unum_setAttribute(fmt, UNUM_PARSE_CASE_SENSITIVE, 1);
+ int32_t ppos = 0;
+ result = unum_parseDouble(fmt, u"1e2", -1, &ppos, &status);
+ assertSuccess("Parsing with UNumberFormat, case sensitive", &status);
+ assertIntEquals("Position with case sensitive", 1, ppos);
+ assertIntEquals("Result with case sensitive", 1, result);
+ unum_close(fmt);
+}
+
static void TestUFormattable(void) {
UChar out2k[2048];
// simple test for API docs
TESTCASE_AUTO(TestFastFormatInt32);
TESTCASE_AUTO(Test11646_Equality);
TESTCASE_AUTO(TestParseNaN);
+ TESTCASE_AUTO(TestFormatFailIfMoreThanMaxDigits);
+ TESTCASE_AUTO(TestParseCaseSensitive);
+ TESTCASE_AUTO(TestParseNoExponent);
+ TESTCASE_AUTO(TestSignAlwaysShown);
+ TESTCASE_AUTO(TestMinimumGroupingDigits);
TESTCASE_AUTO(Test11897_LocalizedPatternSeparator);
TESTCASE_AUTO(Test13055_PercentageRounding);
TESTCASE_AUTO(Test11839);
assertEquals("NaN should round-trip", u"NaN", formatResult);
}
+void NumberFormatTest::TestFormatFailIfMoreThanMaxDigits() {
+ IcuTestErrorCode status(*this, "TestFormatFailIfMoreThanMaxDigits");
+
+ DecimalFormat df("0", {"en-US", status}, status);
+ if (status.errDataIfFailureAndReset()) {
+ return;
+ }
+ assertEquals("Coverage for getter 1", (UBool) FALSE, df.isFormatFailIfMoreThanMaxDigits());
+ df.setFormatFailIfMoreThanMaxDigits(TRUE);
+ assertEquals("Coverage for getter 2", (UBool) TRUE, df.isFormatFailIfMoreThanMaxDigits());
+ df.setMaximumIntegerDigits(2);
+ UnicodeString result;
+ df.format(1234, result, status);
+ status.expectErrorAndReset(U_ILLEGAL_ARGUMENT_ERROR);
+}
+
+void NumberFormatTest::TestParseCaseSensitive() {
+ IcuTestErrorCode status(*this, "TestParseCaseSensitive");
+
+ DecimalFormat df(u"0", {"en-US", status}, status);
+ if (status.errDataIfFailureAndReset()) {
+ return;
+ }
+ assertEquals("Coverage for getter 1", (UBool) FALSE, df.isParseCaseSensitive());
+ df.setParseCaseSensitive(TRUE);
+ assertEquals("Coverage for getter 1", (UBool) TRUE, df.isParseCaseSensitive());
+ Formattable result;
+ ParsePosition ppos;
+ df.parse(u"1e2", result, ppos);
+ assertEquals("Should parse only 1 digit", 1, ppos.getIndex());
+ assertEquals("Result should be 1", 1.0, result.getDouble(status));
+}
+
+void NumberFormatTest::TestParseNoExponent() {
+ IcuTestErrorCode status(*this, "TestParseNoExponent");
+
+ DecimalFormat df(u"0", {"en-US", status}, status);
+ if (status.errDataIfFailureAndReset()) {
+ return;
+ }
+ assertEquals("Coverage for getter 1", (UBool) FALSE, df.isParseNoExponent());
+ df.setParseNoExponent(TRUE);
+ assertEquals("Coverage for getter 1", (UBool) TRUE, df.isParseNoExponent());
+ Formattable result;
+ ParsePosition ppos;
+ df.parse(u"1E2", result, ppos);
+ assertEquals("Should parse only 1 digit", 1, ppos.getIndex());
+ assertEquals("Result should be 1", 1.0, result.getDouble(status));
+}
+
+void NumberFormatTest::TestSignAlwaysShown() {
+ IcuTestErrorCode status(*this, "TestSignAlwaysShown");
+
+ DecimalFormat df(u"0", {"en-US", status}, status);
+ if (status.errDataIfFailureAndReset()) {
+ return;
+ }
+ assertEquals("Coverage for getter 1", (UBool) FALSE, df.isSignAlwaysShown());
+ df.setSignAlwaysShown(TRUE);
+ assertEquals("Coverage for getter 1", (UBool) TRUE, df.isSignAlwaysShown());
+ UnicodeString result;
+ df.format(1234, result, status);
+ status.errIfFailureAndReset();
+ assertEquals("Should show sign on positive number", u"+1234", result);
+}
+
+void NumberFormatTest::TestMinimumGroupingDigits() {
+ IcuTestErrorCode status(*this, "TestMinimumGroupingDigits");
+
+ DecimalFormat df(u"#,##0", {"en-US", status}, status);
+ if (status.errDataIfFailureAndReset()) {
+ return;
+ }
+ assertEquals("Coverage for getter 1", -1, df.getMinimumGroupingDigits());
+ df.setMinimumGroupingDigits(2);
+ assertEquals("Coverage for getter 1", 2, df.getMinimumGroupingDigits());
+ UnicodeString result;
+ df.format(1234, result, status);
+ status.errIfFailureAndReset();
+ assertEquals("Should not have grouping", u"1234", result);
+ df.format(12345, result.remove(), status);
+ status.errIfFailureAndReset();
+ assertEquals("Should have grouping", u"12,345", result);
+}
+
void NumberFormatTest::Test11897_LocalizedPatternSeparator() {
IcuTestErrorCode status(*this, "Test11897_LocalizedPatternSeparator");
void TestFastFormatInt32();
void Test11646_Equality();
void TestParseNaN();
+ void TestFormatFailIfMoreThanMaxDigits();
+ void TestParseCaseSensitive();
+ void TestParseNoExponent();
+ void TestSignAlwaysShown();
+ void TestMinimumGroupingDigits();
void Test11897_LocalizedPatternSeparator();
void Test13055_PercentageRounding();
void Test11839();
/**
* {@icu} Returns whether the sign is being shown on positive numbers.
*
+ * @return Whether the sign is shown on positive numbers and zero.
* @see #setSignAlwaysShown
* @category Affixes
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
- public synchronized boolean getSignAlwaysShown() {
+ public synchronized boolean isSignAlwaysShown() {
// This is not in the exported properties
return properties.getSignAlwaysShown();
}
* explicit plus sign, such as "+0;-0". The behavior when combining this method with explicit plus
* signs in the pattern is undefined.
*
- * @param value true to always show a sign; false to hide the sign on positive numbers.
+ * @param value true to always show a sign; false to hide the sign on positive numbers and zero.
* @category Affixes
- * @internal
- * @deprecated ICU 59: This API is technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
public synchronized void setSignAlwaysShown(boolean value) {
properties.setSignAlwaysShown(value);
refreshFormatter();
*
* @see #setMinimumGroupingDigits
* @category Separators
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
public synchronized int getMinimumGroupingDigits() {
if (properties.getMinimumGroupingDigits() > 0) {
return properties.getMinimumGroupingDigits();
*
* @param number The minimum number of digits before grouping is triggered.
* @category Separators
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
public synchronized void setMinimumGroupingDigits(int number) {
properties.setMinimumGroupingDigits(number);
refreshFormatter();
*
* @see #setParseNoExponent
* @category Parsing
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
- public synchronized boolean getParseNoExponent() {
+ public synchronized boolean isParseNoExponent() {
return properties.getParseNoExponent();
}
*
* @param value true to prevent exponents from being parsed; false to allow them to be parsed.
* @category Parsing
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
public synchronized void setParseNoExponent(boolean value) {
properties.setParseNoExponent(value);
refreshFormatter();
*
* @see #setParseNoExponent
* @category Parsing
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
- public synchronized boolean getParseCaseSensitive() {
+ public synchronized boolean isParseCaseSensitive() {
return properties.getParseCaseSensitive();
}
* @param value true to force case (uppercase/lowercase) to match when parsing; false to ignore
* case and perform case folding.
* @category Parsing
- * @internal
- * @deprecated ICU 59: This API is a technical preview. It may change in an upcoming release.
+ * @draft ICU 64
+ * @provisional This API might change or be removed in a future release.
*/
- @Deprecated
public synchronized void setParseCaseSensitive(boolean value) {
properties.setParseCaseSensitive(value);
refreshFormatter();
@Test
public void testParseNoExponent() throws ParseException {
DecimalFormat df = new DecimalFormat();
- assertEquals("Parse no exponent has wrong default", false, df.getParseNoExponent());
+ assertEquals("Parse no exponent has wrong default", false, df.isParseNoExponent());
Number result1 = df.parse("123E4");
df.setParseNoExponent(true);
- assertEquals("Parse no exponent getter is broken", true, df.getParseNoExponent());
+ assertEquals("Parse no exponent getter is broken", true, df.isParseNoExponent());
Number result2 = df.parse("123E4");
assertEquals("Exponent did not parse before setParseNoExponent", result1, new Long(1230000));
assertEquals("Exponent parsed after setParseNoExponent", result2, new Long(123));
for (int p = 0; p < patterns.length; p++) {
String pat = patterns[p];
DecimalFormat df = new DecimalFormat(pat);
- assertEquals("parseCaseSensitive default is wrong", false, df.getParseCaseSensitive());
+ assertEquals("parseCaseSensitive default is wrong", false, df.isParseCaseSensitive());
for (int i = 0; i < inputs.length; i++) {
String inp = inputs[i];
df.setParseCaseSensitive(false);
- assertEquals("parseCaseSensitive getter is broken", false, df.getParseCaseSensitive());
+ assertEquals("parseCaseSensitive getter is broken", false, df.isParseCaseSensitive());
ParsePosition actualInsensitive = new ParsePosition(0);
df.parse(inp, actualInsensitive);
assertEquals("Insensitive, pattern "+p+", input "+i,
expectedParsePositions[p*2][i], actualInsensitive.getIndex());
df.setParseCaseSensitive(true);
- assertEquals("parseCaseSensitive getter is broken", true, df.getParseCaseSensitive());
+ assertEquals("parseCaseSensitive getter is broken", true, df.isParseCaseSensitive());
ParsePosition actualSensitive = new ParsePosition(0);
df.parse(inp, actualSensitive);
assertEquals("Sensitive, pattern "+p+", input "+i,
for (int i=0; i<locs.length; i++) {
ULocale loc = locs[i];
DecimalFormat df1 = (DecimalFormat) NumberFormat.getNumberInstance(loc);
- assertFalse("Default should be false", df1.getSignAlwaysShown());
+ assertFalse("Default should be false", df1.isSignAlwaysShown());
df1.setSignAlwaysShown(true);
- assertTrue("Getter should now return true", df1.getSignAlwaysShown());
+ assertTrue("Getter should now return true", df1.isSignAlwaysShown());
DecimalFormat df2 = (DecimalFormat) NumberFormat.getCurrencyInstance(loc);
- assertFalse("Default should be false", df2.getSignAlwaysShown());
+ assertFalse("Default should be false", df2.isSignAlwaysShown());
df2.setSignAlwaysShown(true);
- assertTrue("Getter should now return true", df2.getSignAlwaysShown());
+ assertTrue("Getter should now return true", df2.isSignAlwaysShown());
for (int j=0; j<2; j++) {
DecimalFormat df = (j == 0) ? df1 : df2;
for (int k=0; k<numbers.length; k++) {