]> granicus.if.org Git - icu/commitdiff
ICU-20313 Adding more docs about thread-safety of Number[Range]Formatter.
authorShane Carr <shane@unicode.org>
Thu, 14 Feb 2019 21:42:29 +0000 (13:42 -0800)
committerShane F. Carr <shane@unicode.org>
Sat, 16 Feb 2019 01:08:51 +0000 (17:08 -0800)
icu4c/source/i18n/unicode/numberformatter.h
icu4c/source/i18n/unicode/numberrangeformatter.h
icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumber.java
icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java
icu4j/main/classes/core/src/com/ibm/icu/number/LocalizedNumberFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/LocalizedNumberRangeFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/NumberFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/UnlocalizedNumberFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/UnlocalizedNumberRangeFormatter.java

index 895ebd03ee955512d9ee4d197dd84a543bb1beba..37231039e5c9e24a89e298180cd08cc21da36287 100644 (file)
@@ -63,7 +63,8 @@
  * This API offers more features than DecimalFormat and is geared toward new users of ICU.
  *
  * <p>
- * NumberFormatter instances are immutable and thread safe. This means that invoking a configuration method has no
+ * NumberFormatter instances (i.e., LocalizedNumberFormatter and UnlocalizedNumberFormatter)
+ * are immutable and thread safe. This means that invoking a configuration method has no
  * effect on the receiving instance; you must store and use the new number formatter instance it returns instead.
  *
  * <pre>
@@ -2133,6 +2134,8 @@ class U_I18N_API NumberFormatterSettings {
 /**
  * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be specified.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberFormatter
  * @draft ICU 60
  */
@@ -2211,6 +2214,8 @@ class U_I18N_API UnlocalizedNumberFormatter
 /**
  * A NumberFormatter that has a locale associated with it; this means .format() methods are available.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberFormatter
  * @draft ICU 60
  */
@@ -2392,6 +2397,8 @@ class U_I18N_API LocalizedNumberFormatter
  * The result of a number formatting operation. This class allows the result to be exported in several data types,
  * including a UnicodeString and a FieldPositionIterator.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @draft ICU 60
  */
 class U_I18N_API FormattedNumber : public UMemory, public FormattedValue {
index b23eb9f6d581e6e6a2bca9d4f393acc2ab94ccb7..f7539f0180a655bfed86fb03ad409d546da1bbe8 100644 (file)
@@ -33,7 +33,8 @@
  * // => "750 m - 1.2 km"
  * </pre>
  * <p>
- * Like NumberFormatter, NumberRangeFormatter instances are immutable and thread-safe. This API is based on the
+ * Like NumberFormatter, NumberRangeFormatter instances (i.e., LocalizedNumberRangeFormatter
+ * and UnlocalizedNumberRangeFormatter) are immutable and thread-safe. This API is based on the
  * <em>fluent</em> design pattern popularized by libraries such as Google's Guava.
  *
  * @author Shane Carr
@@ -497,6 +498,8 @@ class U_I18N_API NumberRangeFormatterSettings {
 /**
  * A NumberRangeFormatter that does not yet have a locale. In order to format, a locale must be specified.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberRangeFormatter
  * @draft ICU 63
  */
@@ -576,6 +579,8 @@ class U_I18N_API UnlocalizedNumberRangeFormatter
 /**
  * A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberFormatter
  * @draft ICU 63
  */
@@ -683,6 +688,8 @@ class U_I18N_API LocalizedNumberRangeFormatter
  * The result of a number range formatting operation. This class allows the result to be exported in several data types,
  * including a UnicodeString and a FieldPositionIterator.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @draft ICU 63
  */
 class U_I18N_API FormattedNumberRange : public UMemory, public FormattedValue {
index 75fa46e6f447d21dcd205cfa7ba44774f2957b8d..4fda533b43495763d6988061e07b2c8dde1f0ea4 100644 (file)
@@ -18,6 +18,8 @@ import com.ibm.icu.text.PluralRules.IFixedDecimal;
  * The result of a number formatting operation. This class allows the result to be exported in several
  * data types, including a String, an AttributedCharacterIterator, and a BigDecimal.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @draft ICU 60
  * @provisional This API might change or be removed in a future release.
  * @see NumberFormatter
index 3b37559fe6ac414e433fa847ca2b20ef357023c5..e23a96ded2b54850aa4f2fe2f1017ba2e1148753 100644 (file)
@@ -19,6 +19,8 @@ import com.ibm.icu.util.ICUUncheckedIOException;
  * The result of a number range formatting operation. This class allows the result to be exported in several data types,
  * including a String, an AttributedCharacterIterator, and a BigDecimal.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @author sffc
  * @draft ICU 63
  * @provisional This API might change or be removed in a future release.
index 281aca5983e541c555bea34b62349cbe6adc2967..d50aeee0dc78c727ce3ddeab32fbb71ea403876a 100644 (file)
@@ -21,6 +21,8 @@ import com.ibm.icu.util.MeasureUnit;
 /**
  * A NumberFormatter that has a locale associated with it; this means .format() methods are available.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberFormatter
  * @draft ICU 60
  * @provisional This API might change or be removed in a future release.
index 27c787534d7cc324d88d42347a9374aa2a355f5b..864493f0782ee0f780d6c0bb29dd713242ff705b 100644 (file)
@@ -8,6 +8,8 @@ import com.ibm.icu.impl.number.DecimalQuantity_DualStorageBCD;
 /**
  * A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @author sffc
  * @draft ICU 63
  * @provisional This API might change or be removed in a future release.
index ac637cb6f1d517b9e5e08a3e09f1b48f912c68fd..928055d605f904962af3ea666131f513b48c76d0 100644 (file)
@@ -43,7 +43,8 @@ import com.ibm.icu.util.ULocale;
  * users of ICU.
  *
  * <p>
- * NumberFormatter instances are immutable and thread safe. This means that invoking a configuration
+ * NumberFormatter instances (i.e., LocalizedNumberFormatter and UnlocalizedNumberFormatter)
+ * are immutable and thread safe. This means that invoking a configuration
  * method has no effect on the receiving instance; you must store and use the new number formatter
  * instance it returns instead.
  *
index d5cccc49622a57bdd718ab88094fd1eec332d689..47abd1de2d41c8bd7807c6eba1ca1171fe10ef20 100644 (file)
@@ -21,7 +21,8 @@ import com.ibm.icu.util.ULocale;
  * // => "750 m - 1.2 km"
  * </pre>
  * <p>
- * Like NumberFormatter, NumberRangeFormatter instances are immutable and thread-safe. This API is based on the
+ * Like NumberFormatter, NumberRangeFormatter instances (i.e., LocalizedNumberRangeFormatter
+ * and UnlocalizedNumberRangeFormatter) are immutable and thread-safe. This API is based on the
  * <em>fluent</em> design pattern popularized by libraries such as Google's Guava.
  *
  * @author sffc
index decce7ffe2efb9531734546d068b82e98acee48a..0f49a5a459da86b4376357210f969dc374bd7ddd 100644 (file)
@@ -10,6 +10,8 @@ import com.ibm.icu.util.ULocale;
  * A NumberFormatter that does not yet have a locale. In order to format numbers, a locale must be
  * specified.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @see NumberFormatter
  * @draft ICU 60
  * @provisional This API might change or be removed in a future release.
index c3ee21e43d06c18370925be345ec8372684859e7..cde4c2f022bbf325ada0845985b034a1be03658e 100644 (file)
@@ -9,6 +9,8 @@ import com.ibm.icu.util.ULocale;
 /**
  * A NumberRangeFormatter that does not yet have a locale. In order to format, a locale must be specified.
  *
+ * Instances of this class are immutable and thread-safe.
+ *
  * @author sffc
  * @draft ICU 63
  * @provisional This API might change or be removed in a future release.