diff options
Diffstat (limited to 'android_icu4j/src/main/java/android/icu/text/DecimalFormat.java')
-rw-r--r-- | android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java b/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java index 60cbca537..9085fbe83 100644 --- a/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java +++ b/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java @@ -900,11 +900,26 @@ public class DecimalFormat extends NumberFormat { if (prefix == null) { throw new NullPointerException(); } + // BEGIN Android-changed: Add an extra method setPositivePrefixLibcore to allow null prefix + setPositivePrefixInternal(prefix); + } + + private void setPositivePrefixInternal(String prefix) { properties.setPositivePrefix(prefix); refreshFormatter(); } /** + * An internal method that allows a null value, unlike setPositivePrefix() + * @see #setPositivePrefix(String) + * @hide draft / provisional / internal are hidden on Android + */ + public synchronized void setPositivePrefixLibcore(String prefix) { + setPositivePrefixInternal(prefix); + // END Android-changed: Add an extra method setPositivePrefixLibcore to allow null prefix + } + + /** * <strong>Affixes:</strong> Gets the negative prefix string currently being used to format * numbers. * @@ -933,11 +948,26 @@ public class DecimalFormat extends NumberFormat { if (prefix == null) { throw new NullPointerException(); } + // BEGIN Android-changed: Add an extra method setNegativePrefixLibcore to allow null prefix + setNegativePrefixInternal(prefix); + } + + private void setNegativePrefixInternal(String prefix) { properties.setNegativePrefix(prefix); refreshFormatter(); } /** + * An internal method that allows a null value, unlike setNegativePrefix() + * @see #setNegativePrefix(String) + * @hide draft / provisional / internal are hidden on Android + */ + public synchronized void setNegativePrefixLibcore(String prefix) { + setNegativePrefixInternal(prefix); + // END Android-changed: Add an extra method setNegativePrefixLibcore to allow null prefix + } + + /** * <strong>Affixes:</strong> Gets the positive suffix string currently being used to format * numbers. * @@ -966,11 +996,26 @@ public class DecimalFormat extends NumberFormat { if (suffix == null) { throw new NullPointerException(); } + // BEGIN Android-changed: Add an extra method setPositiveSuffixLibcore to allow null suffix + setPositiveSuffixInternal(suffix); + } + + private void setPositiveSuffixInternal(String suffix) { properties.setPositiveSuffix(suffix); refreshFormatter(); } /** + * An internal method that allows a null value, unlike setPositiveSuffix() + * @see #setPositiveSuffix(String) + * @hide draft / provisional / internal are hidden on Android + */ + public synchronized void setPositiveSuffixLibcore(String suffix) { + setPositiveSuffixInternal(suffix); + // END Android-changed: Add an extra method setPositiveSuffixLibcore to allow null suffix + } + + /** * <strong>Affixes:</strong> Gets the negative suffix string currently being used to format * numbers. * @@ -999,11 +1044,26 @@ public class DecimalFormat extends NumberFormat { if (suffix == null) { throw new NullPointerException(); } + // BEGIN Android-changed: Add an extra method setNegativeSuffixLibcore to allow null suffix + setNegativeSuffixInternal(suffix); + } + + private void setNegativeSuffixInternal(String suffix) { properties.setNegativeSuffix(suffix); refreshFormatter(); } /** + * An internal method that allows a null value, unlike setNegativeSuffix() + * @see #setNegativeSuffix(String) + * @hide draft / provisional / internal are hidden on Android + */ + public synchronized void setNegativeSuffixLibcore(String suffix) { + setNegativeSuffixInternal(suffix); + // END Android-changed: Add an extra method setNegativeSuffixLibcore to allow null suffix + } + + /** * <strong>[icu]</strong> Returns whether the sign is being shown on positive numbers. * * @see #setSignAlwaysShown @@ -2028,6 +2088,16 @@ public class DecimalFormat extends NumberFormat { refreshFormatter(); } + // BEGIN Android-added: Compatibility mode for j.t.DecimalFormat. http://b/112355520 + /** + * @hide draft / provisional / internal are hidden on Android + */ + public synchronized void setParseStrictMode(ParseMode parseMode) { + properties.setParseMode(parseMode); + refreshFormatter(); + } + // END Android-added: Compatibility mode for j.t.DecimalFormat. http://b/112355520 + /** * {@inheritDoc} * |