]> granicus.if.org Git - icu/commitdiff
ICU-11276 Feedback from ICU-TC. Fixing doxygen warnings.
authorShane Carr <shane@unicode.org>
Thu, 30 Aug 2018 00:42:17 +0000 (17:42 -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/numrange_types.h
icu4c/source/i18n/unicode/numberrangeformatter.h
icu4j/main/classes/core/src/com/ibm/icu/number/FormattedNumberRange.java
icu4j/main/classes/core/src/com/ibm/icu/number/LocalizedNumberRangeFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatter.java
icu4j/main/classes/core/src/com/ibm/icu/number/NumberRangeFormatterSettings.java

index b6fc758d8e90a0b096b963c399c96c326a8f2a50..1641ccd67acc3b8e9afd8d2e149fc1fe318d6e71 100644 (file)
@@ -266,7 +266,7 @@ void LocalizedNumberRangeFormatter::formatImpl(
         return;
     }
 
-    results->identityType = UNUM_IDENTITY_TYPE_NOT_EQUAL;
+    results->identityResult = UNUM_IDENTITY_RESULT_NOT_EQUAL;
 }
 
 
@@ -361,15 +361,15 @@ UnicodeString FormattedNumberRange::getSecondDecimal(UErrorCode& status) const {
     return fResults->quantity2.toScientificString();
 }
 
-UNumberRangeIdentityType FormattedNumberRange::getIdentityType(UErrorCode& status) const {
+UNumberRangeIdentityResult FormattedNumberRange::getIdentityResult(UErrorCode& status) const {
     if (U_FAILURE(status)) {
-        return UNUM_IDENTITY_TYPE_NOT_EQUAL;
+        return UNUM_IDENTITY_RESULT_NOT_EQUAL;
     }
     if (fResults == nullptr) {
         status = fErrorCode;
-        return UNUM_IDENTITY_TYPE_NOT_EQUAL;
+        return UNUM_IDENTITY_RESULT_NOT_EQUAL;
     }
-    return fResults->identityType;
+    return fResults->identityResult;
 }
 
 FormattedNumberRange::~FormattedNumberRange() {
index c3fef3789af051a2e26d4dea44fdfc2bc02c0e0c..2a2820cda2418c02f8e31fdcb6a4a5ca8e5fdbac 100644 (file)
@@ -36,7 +36,7 @@ struct UFormattedNumberRangeData : public UMemory {
     DecimalQuantity quantity1;
     DecimalQuantity quantity2;
     NumberStringBuilder string;
-    UNumberRangeIdentityType identityType = UNUM_IDENTITY_TYPE_EQUAL_BEFORE_ROUNDING;
+    UNumberRangeIdentityResult identityResult = UNUM_IDENTITY_RESULT_EQUAL_BEFORE_ROUNDING;
 
     // No C conversion methods (no C API yet)
 };
index fe28ccf393a8d416dffa27bae3c48e54c7c00ae3..1704778c1fafccc1526d90e8535b56fcbcde0371 100644 (file)
@@ -52,6 +52,8 @@ typedef enum UNumberRangeCollapse {
      * Use locale data and heuristics to determine how much of the string to collapse. Could end up collapsing none,
      * some, or all repeated pieces in a locale-sensitive way.
      *
+     * The heuristics used for this option are subject to change over time.
+     *
      * @draft ICU 63
      */
     UNUM_RANGE_COLLAPSE_AUTO,
@@ -85,7 +87,6 @@ typedef enum UNumberRangeCollapse {
  * when the identity fallback is used, compare the lower and upper BigDecimals via FormattedNumber.
  *
  * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
  * @see NumberRangeFormatter
  */
 typedef enum UNumberRangeIdentityFallback {
@@ -126,37 +127,33 @@ typedef enum UNumberRangeIdentityFallback {
  * were equal or not, and whether or not the identity fallback was applied.
  *
  * @draft ICU 63
- * @provisional This API might change or be removed in a future release.
  * @see NumberRangeFormatter
  */
-typedef enum UNumberRangeIdentityType {
+typedef enum UNumberRangeIdentityResult {
     /**
      * Used to indicate that the two numbers in the range were equal, even before any rounding rules were applied.
      *
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      */
-    UNUM_IDENTITY_TYPE_EQUAL_BEFORE_ROUNDING,
+    UNUM_IDENTITY_RESULT_EQUAL_BEFORE_ROUNDING,
 
     /**
      * Used to indicate that the two numbers in the range were equal, but only after rounding rules were applied.
      *
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      */
-    UNUM_IDENTITY_TYPE_EQUAL_AFTER_ROUNDING,
+    UNUM_IDENTITY_RESULT_EQUAL_AFTER_ROUNDING,
 
     /**
      * Used to indicate that the two numbers in the range were not equal, even after rounding rules were applied.
      *
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      */
-    UNUM_IDENTITY_TYPE_NOT_EQUAL
-} UNumberRangeIdentityType;
+    UNUM_IDENTITY_RESULT_NOT_EQUAL
+} UNumberRangeIdentityResult;
 
 U_NAMESPACE_BEGIN
 
@@ -366,6 +363,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * <li>UNIT: "3K - 5K miles"</li>
      * <li>NONE: "3K miles - 5K miles"</li>
      * <li>AUTO: usually UNIT or NONE, depending on the locale and formatter settings</li>
+     * </ul>
      * <p>
      * The default value is AUTO.
      *
@@ -398,6 +396,7 @@ class U_I18N_API NumberRangeFormatterSettings {
      * rounding was applied</li>
      * <li>APPROXIMATELY: "~5 miles"</li>
      * <li>RANGE: "5-5 miles" (with collapse=UNIT)</li>
+     * </ul>
      * <p>
      * The default value is APPROXIMATELY.
      *
@@ -436,10 +435,9 @@ class U_I18N_API NumberRangeFormatterSettings {
 
     // NOTE: Uses default copy and move constructors.
 
-  protected:
+  private:
     impl::RangeMacroProps fMacros;
 
-  private:
     // Don't construct me directly!  Use (Un)LocalizedNumberFormatter.
     NumberRangeFormatterSettings() = default;
 
@@ -544,6 +542,8 @@ class U_I18N_API LocalizedNumberRangeFormatter
      *            The first number in the range, usually to the left in LTR locales.
      * @param second
      *            The second number in the range, usually to the right in LTR locales.
+     * @param status
+     *            Set if an error occurs while formatting.
      * @return A FormattedNumberRange object; call .toString() to get the string.
      * @draft ICU 63
      */
@@ -589,6 +589,8 @@ class U_I18N_API LocalizedNumberRangeFormatter
     /**
      * @param results
      *            The results object. This method will mutate it to save the results.
+     * @param status
+     *            Set if an error occurs while formatting.
      * @internal
      */
     void formatImpl(impl::UFormattedNumberRangeData* results, UErrorCode& status) const;
@@ -674,7 +676,7 @@ class U_I18N_API FormattedNumberRange : public UMemory {
      * information, use #getAllFieldPositions().
      *
      * @param fieldPosition
-     *            Input+output variable. See {@link FormattedNumber#nextFieldPosition(FieldPosition)}.
+     *            Input+output variable. See {@link FormattedNumber#nextFieldPosition}.
      * @param status
      *            Set if an error occurs while populating the FieldPosition.
      * @return TRUE if a new occurrence of the field was found; FALSE otherwise.
@@ -709,7 +711,6 @@ class U_I18N_API FormattedNumberRange : public UMemory {
      *
      * @return A decimal representation of the first formatted number.
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      * @see #getSecondDecimal
      */
@@ -726,7 +727,6 @@ class U_I18N_API FormattedNumberRange : public UMemory {
      *
      * @return A decimal representation of the second formatted number.
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      * @see #getFirstDecimal
      */
@@ -739,10 +739,9 @@ class U_I18N_API FormattedNumberRange : public UMemory {
      *
      * @return An indication the resulting identity situation in the formatted number range.
      * @draft ICU 63
-     * @provisional This API might change or be removed in a future release.
      * @see UNumberRangeIdentityFallback
      */
-    UNumberRangeIdentityType getIdentityType(UErrorCode& status) const;
+    UNumberRangeIdentityResult getIdentityResult(UErrorCode& status) const;
 
     /**
      * Copying not supported; use move constructor instead.
index 132420e154c562ed6975aea0a9c453b4cec41a94..50087e98f7ee06d41b40ffa9c3120529c72a240e 100644 (file)
@@ -10,7 +10,7 @@ import java.util.Arrays;
 
 import com.ibm.icu.impl.number.DecimalQuantity;
 import com.ibm.icu.impl.number.NumberStringBuilder;
-import com.ibm.icu.number.NumberRangeFormatter.RangeIdentityType;
+import com.ibm.icu.number.NumberRangeFormatter.RangeIdentityResult;
 import com.ibm.icu.util.ICUUncheckedIOException;
 
 /**
@@ -26,14 +26,14 @@ public class FormattedNumberRange {
     final NumberStringBuilder nsb;
     final DecimalQuantity first;
     final DecimalQuantity second;
-    final RangeIdentityType identityType;
+    final RangeIdentityResult identityResult;
 
     FormattedNumberRange(NumberStringBuilder nsb, DecimalQuantity first, DecimalQuantity second,
-            RangeIdentityType identityType) {
+            RangeIdentityResult identityResult) {
         this.nsb = nsb;
         this.first = first;
         this.second = second;
-        this.identityType = identityType;
+        this.identityResult = identityResult;
     }
 
     /**
@@ -165,8 +165,8 @@ public class FormattedNumberRange {
      * @see NumberRangeFormatter
      * @see NumberRangeFormatter.RangeIdentityFallback
      */
-    public RangeIdentityType getIdentityType() {
-        return identityType;
+    public RangeIdentityResult getIdentityResult() {
+        return identityResult;
     }
 
     /**
index 33aa65be7fe03b87d8dc9cf5c91ab8a4ac7b8c29..8973aae4233a71e71e2a8c62ecb913448e7923cf 100644 (file)
@@ -6,7 +6,7 @@ import com.ibm.icu.impl.number.DecimalQuantity;
 import com.ibm.icu.impl.number.DecimalQuantity_DualStorageBCD;
 import com.ibm.icu.impl.number.NumberStringBuilder;
 import com.ibm.icu.impl.number.range.RangeMacroProps;
-import com.ibm.icu.number.NumberRangeFormatter.RangeIdentityType;
+import com.ibm.icu.number.NumberRangeFormatter.RangeIdentityResult;
 
 /**
  * A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.
@@ -104,9 +104,9 @@ public class LocalizedNumberRangeFormatter extends NumberRangeFormatterSettings<
         nsb.append(r1.nsb);
         nsb.append(" --- ", null);
         nsb.append(r2.nsb);
-        RangeIdentityType identityType = equalBeforeRounding ? RangeIdentityType.EQUAL_BEFORE_ROUNDING
-                : RangeIdentityType.NOT_EQUAL;
-        return new FormattedNumberRange(nsb, first, second, identityType);
+        RangeIdentityResult identityResult = equalBeforeRounding ? RangeIdentityResult.EQUAL_BEFORE_ROUNDING
+                : RangeIdentityResult.NOT_EQUAL;
+        return new FormattedNumberRange(nsb, first, second, identityResult);
     }
 
     @Override
index 437d1b86978c8167bffc509d4e5e5e28ec852de6..c1ad0aab6007f42eecacff75834d638fbe1c9b3d 100644 (file)
@@ -13,10 +13,13 @@ import com.ibm.icu.util.ULocale;
  * <p>
  *
  * <pre>
- * NumberRangeFormatter.with().identityFallback(RangeIdentityFallback.APPROXIMATELY_OR_SINGLE_VALUE)
+ * NumberRangeFormatter.with()
+ *         .identityFallback(RangeIdentityFallback.APPROXIMATELY_OR_SINGLE_VALUE)
  *         .numberFormatterFirst(NumberFormatter.with().unit(MeasureUnit.METER))
- *         .numberFormatterSecond(NumberFormatter.with().unit(MeasureUnit.KILOMETER)).locale(ULocale.UK)
- *         .formatRange(750, 1.2).toString();
+ *         .numberFormatterSecond(NumberFormatter.with().unit(MeasureUnit.KILOMETER))
+ *         .locale(ULocale.UK)
+ *         .formatRange(750, 1.2)
+ *         .toString();
  * // => "750 m - 1.2 km"
  * </pre>
  * <p>
@@ -41,6 +44,8 @@ public abstract class NumberRangeFormatter {
         /**
          * Use locale data and heuristics to determine how much of the string to collapse. Could end up collapsing none,
          * some, or all repeated pieces in a locale-sensitive way.
+         * <p>
+         * The heuristics used for this option are subject to change over time.
          *
          * @draft ICU 63
          * @provisional This API might change or be removed in a future release.
@@ -135,7 +140,7 @@ public abstract class NumberRangeFormatter {
      * @provisional This API might change or be removed in a future release.
      * @see NumberRangeFormatter
      */
-    public static enum RangeIdentityType {
+    public static enum RangeIdentityResult {
         /**
          * Used to indicate that the two numbers in the range were equal, even before any rounding rules were applied.
          *
@@ -190,6 +195,15 @@ public abstract class NumberRangeFormatter {
         return BASE.locale(locale);
     }
 
+    /**
+     * Call this method at the beginning of a NumberRangeFormatter fluent chain in which the locale is known at the call
+     * site.
+     *
+     * @param locale
+     *            The locale from which to load formats and symbols for number range formatting.
+     * @return A {@link LocalizedNumberRangeFormatter}, to be used for chaining.
+     * @draft ICU 63
+     */
     public static LocalizedNumberRangeFormatter withLocale(ULocale locale) {
         return BASE.locale(locale);
     }
index 4971a9e6c1fe14b1ff1a3ef2e0ae17ef0186d088..683ef9ffcd7ed25cb2cde1f6370dde02f1dcce09 100644 (file)
@@ -102,6 +102,7 @@ public abstract class NumberRangeFormatterSettings<T extends NumberRangeFormatte
      * <li>UNIT: "3K - 5K miles"</li>
      * <li>NONE: "3K miles - 5K miles"</li>
      * <li>AUTO: usually UNIT or NONE, depending on the locale and formatter settings</li>
+     * </ul>
      * <p>
      * The default value is AUTO.
      *
@@ -127,6 +128,7 @@ public abstract class NumberRangeFormatterSettings<T extends NumberRangeFormatte
      * rounding was applied</li>
      * <li>APPROXIMATELY: "~5 miles"</li>
      * <li>RANGE: "5-5 miles" (with collapse=UNIT)</li>
+     * </ul>
      * <p>
      * The default value is APPROXIMATELY.
      *
@@ -195,7 +197,7 @@ public abstract class NumberRangeFormatterSettings<T extends NumberRangeFormatte
     /**
      * {@inheritDoc}
      *
-     * @draft ICU 60
+     * @draft ICU 63
      * @provisional This API might change or be removed in a future release.
      */
     @Override
@@ -206,7 +208,7 @@ public abstract class NumberRangeFormatterSettings<T extends NumberRangeFormatte
     /**
      * {@inheritDoc}
      *
-     * @draft ICU 60
+     * @draft ICU 63
      * @provisional This API might change or be removed in a future release.
      */
     @Override