From: Shane Carr Date: Thu, 30 Aug 2018 23:20:13 +0000 (-0700) Subject: ICU-11276 Replying to code review comments. X-Git-Tag: release-63-rc~63^2~27 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8210f9e7d30dc7bfaae035a587b2eeaed3e6481f;p=icu ICU-11276 Replying to code review comments. --- diff --git a/icu4c/source/i18n/numrange_fluent.cpp b/icu4c/source/i18n/numrange_fluent.cpp index 1641ccd67ac..5dcd38554c7 100644 --- a/icu4c/source/i18n/numrange_fluent.cpp +++ b/icu4c/source/i18n/numrange_fluent.cpp @@ -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; } diff --git a/icu4c/source/i18n/unicode/numberformatter.h b/icu4c/source/i18n/unicode/numberformatter.h index 2d37126a379..64572cbf8c2 100644 --- a/icu4c/source/i18n/unicode/numberformatter.h +++ b/icu4c/source/i18n/unicode/numberformatter.h @@ -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 field 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 + * field 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 diff --git a/icu4c/source/i18n/unicode/numberrangeformatter.h b/icu4c/source/i18n/unicode/numberrangeformatter.h index 1704778c1fa..c5e2c0eb9ac 100644 --- a/icu4c/source/i18n/unicode/numberrangeformatter.h +++ b/icu4c/source/i18n/unicode/numberrangeformatter.h @@ -34,10 +34,6 @@ * Like NumberFormatter, NumberRangeFormatter instances are immutable and thread-safe. This API is based on the * fluent design pattern popularized by libraries such as Google's Guava. * - *

- * This API is based on the fluent design pattern popularized by libraries such as Google's Guava. For - * extensive details on the design of this API, read the design doc. - * * @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 field 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 + * field 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. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumber.java b/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumber.java index 34030048ce4..9febde4358c 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumber.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumber.java @@ -70,9 +70,9 @@ public class FormattedNumber { } /** - * Determine the start and end indices of the first occurrence of the given field 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 + * field in the output string. This allows you to determine the locations of, for example, + * the integer part, fraction part, or symbols. * *

* If multiple different field attributes are needed, this method can be called repeatedly, or if diff --git a/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java b/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java index 50087e98f7e..a759fa4ebd7 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java @@ -76,8 +76,9 @@ public class FormattedNumberRange { } /** - * Determines the start and end indices of the next occurrence of the given field 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 + * field 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. diff --git a/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterSettings.java b/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterSettings.java index dd33b1b08c5..40ae7371d6a 100644 --- a/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterSettings.java +++ b/icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterSettings.java @@ -77,7 +77,7 @@ public abstract class NumberRangeFormatterSettings * The NumberFormatter instance must not have a locale applied yet; the locale specified on the * NumberRangeFormatter will be used.