summaryrefslogtreecommitdiff
path: root/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java
diff options
context:
space:
mode:
Diffstat (limited to 'icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java')
-rw-r--r--icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java70
1 files changed, 70 insertions, 0 deletions
diff --git a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java
index f520e5ae5..b894007b3 100644
--- a/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java
+++ b/icu4j/main/classes/core/src/com/ibm/icu/text/DecimalFormat.java
@@ -937,11 +937,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)
+ * @Internal
+ */
+ 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.
*
@@ -974,11 +989,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)
+ * @Internal
+ */
+ 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.
*
@@ -1011,11 +1041,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)
+ * @Internal
+ */
+ 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.
*
@@ -1048,11 +1093,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)
+ * @Internal
+ */
+ public synchronized void setNegativeSuffixLibcore(String suffix) {
+ setNegativeSuffixInternal(suffix);
+ // END Android-changed: Add an extra method setNegativeSuffixLibcore to allow null suffix
+ }
+
+ /**
* {@icu} Returns whether the sign is being shown on positive numbers.
*
* @see #setSignAlwaysShown
@@ -2197,6 +2257,16 @@ public class DecimalFormat extends NumberFormat {
refreshFormatter();
}
+ // BEGIN Android-added: Compatibility mode for j.t.DecimalFormat. http://b/112355520
+ /**
+ * @internal
+ */
+ public synchronized void setParseStrictMode(ParseMode parseMode) {
+ properties.setParseMode(parseMode);
+ refreshFormatter();
+ }
+ // END Android-added: Compatibility mode for j.t.DecimalFormat. http://b/112355520
+
/**
* {@inheritDoc}
*