]> granicus.if.org Git - icu/commitdiff
ICU-11276 Replying to code review comments.
authorShane Carr <shane@unicode.org>
Thu, 30 Aug 2018 23:20:13 +0000 (16:20 -0700)
committerShane Carr <shane@unicode.org>
Thu, 27 Sep 2018 21:27:39 +0000 (14:27 -0700)
icu4c/source/i18n/numrange_fluent.cpp
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/NumberRangeFormatterSettings.java

index 1641ccd67acc3b8e9afd8d2e149fc1fe318d6e71..5dcd38554c77b83b37f6b6ac202ebd5334cf742a 100644 (file)
@@ -298,7 +298,7 @@ UnicodeString FormattedNumberRange::toString(UErrorCode& status) const {
     return fResults->string.toUnicodeString();
 }
 
-Appendable& FormattedNumberRange::appendTo(Appendable& appendable, UErrorCode& status) {
+Appendable& FormattedNumberRange::appendTo(Appendable& appendable, UErrorCode& status) const {
     if (U_FAILURE(status)) {
         return appendable;
     }
index 2d37126a3790377062fa93335e038cebe8bc7588..64572cbf8c27a4df391d96995e7700064470e7e2 100644 (file)
@@ -2451,9 +2451,9 @@ class U_I18N_API FormattedNumber : public UMemory {
 #endif  /* U_HIDE_DEPRECATED_API */
 
     /**
-     * Determines the start and end indices of the next occurrence of the given <em>field</em> in the
-     * output string. This allows you to determine the locations of, for example, the integer part,
-     * fraction part, or symbols.
+     * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
+     * <em>field</em> in the output string. This allows you to determine the locations of, for example,
+     * the integer part, fraction part, or symbols.
      *
      * If a field occurs just once, calling this method will find that occurrence and return it. If a
      * field occurs multiple times, this method may be called repeatedly with the following pattern:
@@ -2472,7 +2472,7 @@ class U_I18N_API FormattedNumber : public UMemory {
      *            Input+output variable. On input, the "field" property determines which field to look
      *            up, and the "beginIndex" and "endIndex" properties determine where to begin the search.
      *            On output, the "beginIndex" is set to the beginning of the first occurrence of the
-     *            field with either begin or end indices after the input indices, "endIndex" is set to
+     *            field with either begin or end indices after the input indices; "endIndex" is set to
      *            the end of that occurrence of the field (exclusive index). If a field position is not
      *            found, the method returns FALSE and the FieldPosition may or may not be changed.
      * @param status
index 1704778c1fafccc1526d90e8535b56fcbcde0371..c5e2c0eb9ac18e6b186a35b72261a1f3521c4b3e 100644 (file)
  * Like NumberFormatter, NumberRangeFormatter instances are immutable and thread-safe. This API is based on the
  * <em>fluent</em> design pattern popularized by libraries such as Google's Guava.
  *
- * <p>
- * This API is based on the <em>fluent</em> design pattern popularized by libraries such as Google's Guava. For
- * extensive details on the design of this API, read <a href="https://goo.gl/szi5VB">the design doc</a>.
- *
  * @author Shane Carr
  */
 
@@ -280,7 +276,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterFirst() for use on an rvalue reference.
      *
      * @param formatterFirst
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the first number in the range.
      * @return The fluent chain.
      * @see #numberFormatterFirst
      * @draft ICU 63
@@ -291,7 +287,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterFirst() for use on an rvalue reference.
      *
      * @param formatterFirst
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the first number in the range.
      * @return The fluent chain.
      * @see #numberFormatterFirst
      * @draft ICU 63
@@ -302,7 +298,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterFirst() for use on an rvalue reference.
      *
      * @param formatterFirst
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the first number in the range.
      * @return The fluent chain.
      * @see #numberFormatterFirst
      * @draft ICU 63
@@ -326,7 +322,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterSecond() for use on an rvalue reference.
      *
      * @param formatterSecond
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the second number in the range.
      * @return The fluent chain.
      * @see #numberFormatterSecond
      * @draft ICU 63
@@ -337,7 +333,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterSecond() for use on an rvalue reference.
      *
      * @param formatterSecond
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the second number in the range.
      * @return The fluent chain.
      * @see #numberFormatterSecond
      * @draft ICU 63
@@ -348,7 +344,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * Overload of numberFormatterSecond() for use on an rvalue reference.
      *
      * @param formatterSecond
-     *            The formatter to use for both numbers in the range.
+     *            The formatter to use for the second number in the range.
      * @return The fluent chain.
      * @see #numberFormatterSecond
      * @draft ICU 63
@@ -652,12 +648,12 @@ class U_I18N_API FormattedNumberRange : public UMemory {
      * @draft ICU 63
      * @see Appendable
      */
-    Appendable &appendTo(Appendable &appendable, UErrorCode& status);
+    Appendable &appendTo(Appendable &appendable, UErrorCode& status) const;
 
     /**
-     * Determines the start and end indices of the next occurrence of the given <em>field</em> in the
-     * output string. This allows you to determine the locations of, for example, the integer part,
-     * fraction part, or symbols.
+     * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
+     * <em>field</em> in the output string. This allows you to determine the locations of, for example,
+     * the integer part, fraction part, or symbols.
      *
      * If both sides of the range have the same field, the field will occur twice, once before the
      * range separator and once after the range separator, if applicable.
index 34030048ce4d86211d86f7ecbba369e9a15249ea..9febde4358c69ccc0d294a6acff735617620d78d 100644 (file)
@@ -70,9 +70,9 @@ public class FormattedNumber {
     }
 
     /**
-     * Determine the start and end indices of the first occurrence of the given <em>field</em> in the
-     * output string. This allows you to determine the locations of the integer part, fraction part, and
-     * sign.
+     * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
+     * <em>field</em> in the output string. This allows you to determine the locations of, for example,
+     * the integer part, fraction part, or symbols.
      *
      * <p>
      * If multiple different field attributes are needed, this method can be called repeatedly, or if
index 50087e98f7ee06d41b40ffa9c3120529c72a240e..a759fa4ebd74cab844bd8216b94a27b897099406 100644 (file)
@@ -76,8 +76,9 @@ public class FormattedNumberRange {
     }
 
     /**
-     * Determines the start and end indices of the next occurrence of the given <em>field</em> in the output string.
-     * This allows you to determine the locations of, for example, the integer part, fraction part, or symbols.
+     * Determines the start (inclusive) and end (exclusive) indices of the next occurrence of the given
+     * <em>field</em> in the output string. This allows you to determine the locations of, for example,
+     * the integer part, fraction part, or symbols.
      * <p>
      * If both sides of the range have the same field, the field will occur twice, once before the range separator and
      * once after the range separator, if applicable.
index dd33b1b08c55aa7b8f24789d03c78805d9eb2ee2..40ae7371d6a7604f50973a432868c3ed94b08b6d 100644 (file)
@@ -77,7 +77,7 @@ public abstract class NumberRangeFormatterSettings<T extends NumberRangeFormatte
     }
 
     /**
-     * Sets the NumberFormatter instances to use for the numbers in the range.
+     * Sets the NumberFormatter instances to use for the second number in the range.
      * <p>
      * The NumberFormatter instance must not have a locale applied yet; the locale specified on the
      * NumberRangeFormatter will be used.