| 1 | // © 2016 and later: Unicode, Inc. and others. |
| 2 | // License & terms of use: http://www.unicode.org/copyright.html |
| 3 | /* |
| 4 | ********************************************************************** |
| 5 | * Copyright (c) 2004-2016, International Business Machines |
| 6 | * Corporation and others. All Rights Reserved. |
| 7 | ********************************************************************** |
| 8 | * Author: Alan Liu |
| 9 | * Created: April 26, 2004 |
| 10 | * Since: ICU 3.0 |
| 11 | ********************************************************************** |
| 12 | */ |
| 13 | #ifndef __MEASUREUNIT_H__ |
| 14 | #define __MEASUREUNIT_H__ |
| 15 | |
| 16 | #include "unicode/utypes.h" |
| 17 | |
| 18 | #if U_SHOW_CPLUSPLUS_API |
| 19 | |
| 20 | #if !UCONFIG_NO_FORMATTING |
| 21 | |
| 22 | #include "unicode/unistr.h" |
| 23 | #include "unicode/localpointer.h" |
| 24 | |
| 25 | /** |
| 26 | * \file |
| 27 | * \brief C++ API: A unit for measuring a quantity. |
| 28 | */ |
| 29 | |
| 30 | U_NAMESPACE_BEGIN |
| 31 | |
| 32 | class StringEnumeration; |
| 33 | class MeasureUnitImpl; |
| 34 | |
| 35 | namespace number { |
| 36 | namespace impl { |
| 37 | class LongNameHandler; |
| 38 | } |
| 39 | } // namespace number |
| 40 | |
| 41 | /** |
| 42 | * Enumeration for unit complexity. There are three levels: |
| 43 | * |
| 44 | * - SINGLE: A single unit, optionally with a power and/or SI or binary prefix. |
| 45 | * Examples: hectare, square-kilometer, kilojoule, per-second, mebibyte. |
| 46 | * - COMPOUND: A unit composed of the product of multiple single units. Examples: |
| 47 | * meter-per-second, kilowatt-hour, kilogram-meter-per-square-second. |
| 48 | * - MIXED: A unit composed of the sum of multiple single units. Examples: foot+inch, |
| 49 | * hour+minute+second, degree+arcminute+arcsecond. |
| 50 | * |
| 51 | * The complexity determines which operations are available. For example, you cannot set the power |
| 52 | * or prefix of a compound unit. |
| 53 | * |
| 54 | * @stable ICU 67 |
| 55 | */ |
| 56 | enum UMeasureUnitComplexity { |
| 57 | /** |
| 58 | * A single unit, like kilojoule. |
| 59 | * |
| 60 | * @stable ICU 67 |
| 61 | */ |
| 62 | UMEASURE_UNIT_SINGLE, |
| 63 | |
| 64 | /** |
| 65 | * A compound unit, like meter-per-second. |
| 66 | * |
| 67 | * @stable ICU 67 |
| 68 | */ |
| 69 | UMEASURE_UNIT_COMPOUND, |
| 70 | |
| 71 | /** |
| 72 | * A mixed unit, like hour+minute. |
| 73 | * |
| 74 | * @stable ICU 67 |
| 75 | */ |
| 76 | UMEASURE_UNIT_MIXED |
| 77 | }; |
| 78 | |
| 79 | |
| 80 | #ifndef U_HIDE_DRAFT_API |
| 81 | /** |
| 82 | * Enumeration for SI and binary prefixes, e.g. "kilo-", "nano-", "mebi-". |
| 83 | * |
| 84 | * Enum values should be treated as opaque: use umeas_getPrefixPower() and |
| 85 | * umeas_getPrefixBase() to find their corresponding values. |
| 86 | * |
| 87 | * @draft ICU 69 |
| 88 | * @see umeas_getPrefixBase |
| 89 | * @see umeas_getPrefixPower |
| 90 | */ |
| 91 | typedef enum UMeasurePrefix { |
| 92 | /** |
| 93 | * The absence of an SI or binary prefix. |
| 94 | * |
| 95 | * The integer representation of this enum value is an arbitrary |
| 96 | * implementation detail and should not be relied upon: use |
| 97 | * umeas_getPrefixPower() to obtain meaningful values. |
| 98 | * |
| 99 | * @draft ICU 69 |
| 100 | */ |
| 101 | UMEASURE_PREFIX_ONE = 30 + 0, |
| 102 | |
| 103 | /** |
| 104 | * SI prefix: yotta, 10^24. |
| 105 | * |
| 106 | * @draft ICU 69 |
| 107 | */ |
| 108 | UMEASURE_PREFIX_YOTTA = UMEASURE_PREFIX_ONE + 24, |
| 109 | |
| 110 | #ifndef U_HIDE_INTERNAL_API |
| 111 | /** |
| 112 | * ICU use only. |
| 113 | * Used to determine the set of base-10 SI prefixes. |
| 114 | * @internal |
| 115 | */ |
| 116 | UMEASURE_PREFIX_INTERNAL_MAX_SI = UMEASURE_PREFIX_YOTTA, |
| 117 | #endif /* U_HIDE_INTERNAL_API */ |
| 118 | |
| 119 | /** |
| 120 | * SI prefix: zetta, 10^21. |
| 121 | * |
| 122 | * @draft ICU 69 |
| 123 | */ |
| 124 | UMEASURE_PREFIX_ZETTA = UMEASURE_PREFIX_ONE + 21, |
| 125 | |
| 126 | /** |
| 127 | * SI prefix: exa, 10^18. |
| 128 | * |
| 129 | * @draft ICU 69 |
| 130 | */ |
| 131 | UMEASURE_PREFIX_EXA = UMEASURE_PREFIX_ONE + 18, |
| 132 | |
| 133 | /** |
| 134 | * SI prefix: peta, 10^15. |
| 135 | * |
| 136 | * @draft ICU 69 |
| 137 | */ |
| 138 | UMEASURE_PREFIX_PETA = UMEASURE_PREFIX_ONE + 15, |
| 139 | |
| 140 | /** |
| 141 | * SI prefix: tera, 10^12. |
| 142 | * |
| 143 | * @draft ICU 69 |
| 144 | */ |
| 145 | UMEASURE_PREFIX_TERA = UMEASURE_PREFIX_ONE + 12, |
| 146 | |
| 147 | /** |
| 148 | * SI prefix: giga, 10^9. |
| 149 | * |
| 150 | * @draft ICU 69 |
| 151 | */ |
| 152 | UMEASURE_PREFIX_GIGA = UMEASURE_PREFIX_ONE + 9, |
| 153 | |
| 154 | /** |
| 155 | * SI prefix: mega, 10^6. |
| 156 | * |
| 157 | * @draft ICU 69 |
| 158 | */ |
| 159 | UMEASURE_PREFIX_MEGA = UMEASURE_PREFIX_ONE + 6, |
| 160 | |
| 161 | /** |
| 162 | * SI prefix: kilo, 10^3. |
| 163 | * |
| 164 | * @draft ICU 69 |
| 165 | */ |
| 166 | UMEASURE_PREFIX_KILO = UMEASURE_PREFIX_ONE + 3, |
| 167 | |
| 168 | /** |
| 169 | * SI prefix: hecto, 10^2. |
| 170 | * |
| 171 | * @draft ICU 69 |
| 172 | */ |
| 173 | UMEASURE_PREFIX_HECTO = UMEASURE_PREFIX_ONE + 2, |
| 174 | |
| 175 | /** |
| 176 | * SI prefix: deka, 10^1. |
| 177 | * |
| 178 | * @draft ICU 69 |
| 179 | */ |
| 180 | UMEASURE_PREFIX_DEKA = UMEASURE_PREFIX_ONE + 1, |
| 181 | |
| 182 | /** |
| 183 | * SI prefix: deci, 10^-1. |
| 184 | * |
| 185 | * @draft ICU 69 |
| 186 | */ |
| 187 | UMEASURE_PREFIX_DECI = UMEASURE_PREFIX_ONE + -1, |
| 188 | |
| 189 | /** |
| 190 | * SI prefix: centi, 10^-2. |
| 191 | * |
| 192 | * @draft ICU 69 |
| 193 | */ |
| 194 | UMEASURE_PREFIX_CENTI = UMEASURE_PREFIX_ONE + -2, |
| 195 | |
| 196 | /** |
| 197 | * SI prefix: milli, 10^-3. |
| 198 | * |
| 199 | * @draft ICU 69 |
| 200 | */ |
| 201 | UMEASURE_PREFIX_MILLI = UMEASURE_PREFIX_ONE + -3, |
| 202 | |
| 203 | /** |
| 204 | * SI prefix: micro, 10^-6. |
| 205 | * |
| 206 | * @draft ICU 69 |
| 207 | */ |
| 208 | UMEASURE_PREFIX_MICRO = UMEASURE_PREFIX_ONE + -6, |
| 209 | |
| 210 | /** |
| 211 | * SI prefix: nano, 10^-9. |
| 212 | * |
| 213 | * @draft ICU 69 |
| 214 | */ |
| 215 | UMEASURE_PREFIX_NANO = UMEASURE_PREFIX_ONE + -9, |
| 216 | |
| 217 | /** |
| 218 | * SI prefix: pico, 10^-12. |
| 219 | * |
| 220 | * @draft ICU 69 |
| 221 | */ |
| 222 | UMEASURE_PREFIX_PICO = UMEASURE_PREFIX_ONE + -12, |
| 223 | |
| 224 | /** |
| 225 | * SI prefix: femto, 10^-15. |
| 226 | * |
| 227 | * @draft ICU 69 |
| 228 | */ |
| 229 | UMEASURE_PREFIX_FEMTO = UMEASURE_PREFIX_ONE + -15, |
| 230 | |
| 231 | /** |
| 232 | * SI prefix: atto, 10^-18. |
| 233 | * |
| 234 | * @draft ICU 69 |
| 235 | */ |
| 236 | UMEASURE_PREFIX_ATTO = UMEASURE_PREFIX_ONE + -18, |
| 237 | |
| 238 | /** |
| 239 | * SI prefix: zepto, 10^-21. |
| 240 | * |
| 241 | * @draft ICU 69 |
| 242 | */ |
| 243 | UMEASURE_PREFIX_ZEPTO = UMEASURE_PREFIX_ONE + -21, |
| 244 | |
| 245 | /** |
| 246 | * SI prefix: yocto, 10^-24. |
| 247 | * |
| 248 | * @draft ICU 69 |
| 249 | */ |
| 250 | UMEASURE_PREFIX_YOCTO = UMEASURE_PREFIX_ONE + -24, |
| 251 | |
| 252 | #ifndef U_HIDE_INTERNAL_API |
| 253 | /** |
| 254 | * ICU use only. |
| 255 | * Used to determine the set of base-10 SI prefixes. |
| 256 | * @internal |
| 257 | */ |
| 258 | UMEASURE_PREFIX_INTERNAL_MIN_SI = UMEASURE_PREFIX_YOCTO, |
| 259 | #endif // U_HIDE_INTERNAL_API |
| 260 | |
| 261 | // Cannot conditionalize the following with #ifndef U_HIDE_INTERNAL_API, |
| 262 | // used in definitions of non-internal enum values |
| 263 | /** |
| 264 | * ICU use only. |
| 265 | * Sets the arbitrary offset of the base-1024 binary prefixes' enum values. |
| 266 | * @internal |
| 267 | */ |
| 268 | UMEASURE_PREFIX_INTERNAL_ONE_BIN = -60, |
| 269 | |
| 270 | /** |
| 271 | * Binary prefix: kibi, 1024^1. |
| 272 | * |
| 273 | * @draft ICU 69 |
| 274 | */ |
| 275 | UMEASURE_PREFIX_KIBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 1, |
| 276 | |
| 277 | #ifndef U_HIDE_INTERNAL_API |
| 278 | /** |
| 279 | * ICU use only. |
| 280 | * Used to determine the set of base-1024 binary prefixes. |
| 281 | * @internal |
| 282 | */ |
| 283 | UMEASURE_PREFIX_INTERNAL_MIN_BIN = UMEASURE_PREFIX_KIBI, |
| 284 | #endif // U_HIDE_INTERNAL_API |
| 285 | |
| 286 | /** |
| 287 | * Binary prefix: mebi, 1024^2. |
| 288 | * |
| 289 | * @draft ICU 69 |
| 290 | */ |
| 291 | UMEASURE_PREFIX_MEBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 2, |
| 292 | |
| 293 | /** |
| 294 | * Binary prefix: gibi, 1024^3. |
| 295 | * |
| 296 | * @draft ICU 69 |
| 297 | */ |
| 298 | UMEASURE_PREFIX_GIBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 3, |
| 299 | |
| 300 | /** |
| 301 | * Binary prefix: tebi, 1024^4. |
| 302 | * |
| 303 | * @draft ICU 69 |
| 304 | */ |
| 305 | UMEASURE_PREFIX_TEBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 4, |
| 306 | |
| 307 | /** |
| 308 | * Binary prefix: pebi, 1024^5. |
| 309 | * |
| 310 | * @draft ICU 69 |
| 311 | */ |
| 312 | UMEASURE_PREFIX_PEBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 5, |
| 313 | |
| 314 | /** |
| 315 | * Binary prefix: exbi, 1024^6. |
| 316 | * |
| 317 | * @draft ICU 69 |
| 318 | */ |
| 319 | UMEASURE_PREFIX_EXBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 6, |
| 320 | |
| 321 | /** |
| 322 | * Binary prefix: zebi, 1024^7. |
| 323 | * |
| 324 | * @draft ICU 69 |
| 325 | */ |
| 326 | UMEASURE_PREFIX_ZEBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 7, |
| 327 | |
| 328 | /** |
| 329 | * Binary prefix: yobi, 1024^8. |
| 330 | * |
| 331 | * @draft ICU 69 |
| 332 | */ |
| 333 | UMEASURE_PREFIX_YOBI = UMEASURE_PREFIX_INTERNAL_ONE_BIN + 8, |
| 334 | |
| 335 | #ifndef U_HIDE_INTERNAL_API |
| 336 | /** |
| 337 | * ICU use only. |
| 338 | * Used to determine the set of base-1024 binary prefixes. |
| 339 | * @internal |
| 340 | */ |
| 341 | UMEASURE_PREFIX_INTERNAL_MAX_BIN = UMEASURE_PREFIX_YOBI, |
| 342 | #endif // U_HIDE_INTERNAL_API |
| 343 | } UMeasurePrefix; |
| 344 | |
| 345 | /** |
| 346 | * Returns the base of the factor associated with the given unit prefix: the |
| 347 | * base is 10 for SI prefixes (kilo, micro) and 1024 for binary prefixes (kibi, |
| 348 | * mebi). |
| 349 | * |
| 350 | * @draft ICU 69 |
| 351 | */ |
| 352 | U_CAPI int32_t U_EXPORT2 umeas_getPrefixBase(UMeasurePrefix unitPrefix); |
| 353 | |
| 354 | /** |
| 355 | * Returns the exponent of the factor associated with the given unit prefix, for |
| 356 | * example 3 for kilo, -6 for micro, 1 for kibi, 2 for mebi, 3 for gibi. |
| 357 | * |
| 358 | * @draft ICU 69 |
| 359 | */ |
| 360 | U_CAPI int32_t U_EXPORT2 umeas_getPrefixPower(UMeasurePrefix unitPrefix); |
| 361 | |
| 362 | #endif // U_HIDE_DRAFT_API |
| 363 | |
| 364 | /** |
| 365 | * A unit such as length, mass, volume, currency, etc. A unit is |
| 366 | * coupled with a numeric amount to produce a Measure. |
| 367 | * |
| 368 | * @author Alan Liu |
| 369 | * @stable ICU 3.0 |
| 370 | */ |
| 371 | class U_I18N_API MeasureUnit: public UObject { |
| 372 | public: |
| 373 | |
| 374 | /** |
| 375 | * Default constructor. |
| 376 | * Populates the instance with the base dimensionless unit. |
| 377 | * @stable ICU 3.0 |
| 378 | */ |
| 379 | MeasureUnit(); |
| 380 | |
| 381 | /** |
| 382 | * Copy constructor. |
| 383 | * @stable ICU 3.0 |
| 384 | */ |
| 385 | MeasureUnit(const MeasureUnit &other); |
| 386 | |
| 387 | /** |
| 388 | * Move constructor. |
| 389 | * @stable ICU 67 |
| 390 | */ |
| 391 | MeasureUnit(MeasureUnit &&other) noexcept; |
| 392 | |
| 393 | /** |
| 394 | * Construct a MeasureUnit from a CLDR Core Unit Identifier, defined in UTS |
| 395 | * 35. (Core unit identifiers and mixed unit identifiers are supported, long |
| 396 | * unit identifiers are not.) Validates and canonicalizes the identifier. |
| 397 | * |
| 398 | * <pre> |
| 399 | * MeasureUnit example = MeasureUnit::forIdentifier("furlong-per-nanosecond") |
| 400 | * </pre> |
| 401 | * |
| 402 | * @param identifier The CLDR Unit Identifier. |
| 403 | * @param status Set if the identifier is invalid. |
| 404 | * @stable ICU 67 |
| 405 | */ |
| 406 | static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status); |
| 407 | |
| 408 | /** |
| 409 | * Copy assignment operator. |
| 410 | * @stable ICU 3.0 |
| 411 | */ |
| 412 | MeasureUnit &operator=(const MeasureUnit &other); |
| 413 | |
| 414 | /** |
| 415 | * Move assignment operator. |
| 416 | * @stable ICU 67 |
| 417 | */ |
| 418 | MeasureUnit &operator=(MeasureUnit &&other) noexcept; |
| 419 | |
| 420 | /** |
| 421 | * Returns a polymorphic clone of this object. The result will |
| 422 | * have the same class as returned by getDynamicClassID(). |
| 423 | * @stable ICU 3.0 |
| 424 | */ |
| 425 | virtual MeasureUnit* clone() const; |
| 426 | |
| 427 | /** |
| 428 | * Destructor |
| 429 | * @stable ICU 3.0 |
| 430 | */ |
| 431 | virtual ~MeasureUnit(); |
| 432 | |
| 433 | /** |
| 434 | * Equality operator. Return true if this object is equal |
| 435 | * to the given object. |
| 436 | * @stable ICU 3.0 |
| 437 | */ |
| 438 | virtual bool operator==(const UObject& other) const; |
| 439 | |
| 440 | /** |
| 441 | * Inequality operator. Return true if this object is not equal |
| 442 | * to the given object. |
| 443 | * @stable ICU 53 |
| 444 | */ |
| 445 | bool operator!=(const UObject& other) const { |
| 446 | return !(*this == other); |
| 447 | } |
| 448 | |
| 449 | /** |
| 450 | * Get the type. |
| 451 | * |
| 452 | * If the unit does not have a type, the empty string is returned. |
| 453 | * |
| 454 | * @stable ICU 53 |
| 455 | */ |
| 456 | const char *getType() const; |
| 457 | |
| 458 | /** |
| 459 | * Get the sub type. |
| 460 | * |
| 461 | * If the unit does not have a subtype, the empty string is returned. |
| 462 | * |
| 463 | * @stable ICU 53 |
| 464 | */ |
| 465 | const char *getSubtype() const; |
| 466 | |
| 467 | /** |
| 468 | * Get CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35. |
| 469 | * |
| 470 | * @return The string form of this unit, owned by this MeasureUnit. |
| 471 | * @stable ICU 67 |
| 472 | */ |
| 473 | const char* getIdentifier() const; |
| 474 | |
| 475 | /** |
| 476 | * Compute the complexity of the unit. See UMeasureUnitComplexity for more information. |
| 477 | * |
| 478 | * @param status Set if an error occurs. |
| 479 | * @return The unit complexity. |
| 480 | * @stable ICU 67 |
| 481 | */ |
| 482 | UMeasureUnitComplexity getComplexity(UErrorCode& status) const; |
| 483 | |
| 484 | #ifndef U_HIDE_DRAFT_API |
| 485 | /** |
| 486 | * Creates a MeasureUnit which is this SINGLE unit augmented with the specified prefix. |
| 487 | * For example, UMEASURE_PREFIX_KILO for "kilo", or UMEASURE_PREFIX_KIBI for "kibi". |
| 488 | * |
| 489 | * There is sufficient locale data to format all standard prefixes. |
| 490 | * |
| 491 | * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will |
| 492 | * occur. For more information, see UMeasureUnitComplexity. |
| 493 | * |
| 494 | * @param prefix The prefix, from UMeasurePrefix. |
| 495 | * @param status Set if this is not a SINGLE unit or if another error occurs. |
| 496 | * @return A new SINGLE unit. |
| 497 | * @draft ICU 69 |
| 498 | */ |
| 499 | MeasureUnit withPrefix(UMeasurePrefix prefix, UErrorCode& status) const; |
| 500 | |
| 501 | /** |
| 502 | * Returns the current SI or binary prefix of this SINGLE unit. For example, |
| 503 | * if the unit has the prefix "kilo", then UMEASURE_PREFIX_KILO is |
| 504 | * returned. |
| 505 | * |
| 506 | * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will |
| 507 | * occur. For more information, see UMeasureUnitComplexity. |
| 508 | * |
| 509 | * @param status Set if this is not a SINGLE unit or if another error occurs. |
| 510 | * @return The prefix of this SINGLE unit, from UMeasurePrefix. |
| 511 | * @see umeas_getPrefixBase |
| 512 | * @see umeas_getPrefixPower |
| 513 | * @draft ICU 69 |
| 514 | */ |
| 515 | UMeasurePrefix getPrefix(UErrorCode& status) const; |
| 516 | #endif // U_HIDE_DRAFT_API |
| 517 | |
| 518 | /** |
| 519 | * Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality |
| 520 | * (power). For example, if dimensionality is 2, the unit will be squared. |
| 521 | * |
| 522 | * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will |
| 523 | * occur. For more information, see UMeasureUnitComplexity. |
| 524 | * |
| 525 | * For the base dimensionless unit, withDimensionality does nothing. |
| 526 | * |
| 527 | * @param dimensionality The dimensionality (power). |
| 528 | * @param status Set if this is not a SINGLE unit or if another error occurs. |
| 529 | * @return A new SINGLE unit. |
| 530 | * @stable ICU 67 |
| 531 | */ |
| 532 | MeasureUnit withDimensionality(int32_t dimensionality, UErrorCode& status) const; |
| 533 | |
| 534 | /** |
| 535 | * Gets the dimensionality (power) of this MeasureUnit. For example, if the unit is square, |
| 536 | * then 2 is returned. |
| 537 | * |
| 538 | * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will |
| 539 | * occur. For more information, see UMeasureUnitComplexity. |
| 540 | * |
| 541 | * For the base dimensionless unit, getDimensionality returns 0. |
| 542 | * |
| 543 | * @param status Set if this is not a SINGLE unit or if another error occurs. |
| 544 | * @return The dimensionality (power) of this simple unit. |
| 545 | * @stable ICU 67 |
| 546 | */ |
| 547 | int32_t getDimensionality(UErrorCode& status) const; |
| 548 | |
| 549 | /** |
| 550 | * Gets the reciprocal of this MeasureUnit, with the numerator and denominator flipped. |
| 551 | * |
| 552 | * For example, if the receiver is "meter-per-second", the unit "second-per-meter" is returned. |
| 553 | * |
| 554 | * NOTE: Only works on SINGLE and COMPOUND units. If this is a MIXED unit, an error will |
| 555 | * occur. For more information, see UMeasureUnitComplexity. |
| 556 | * |
| 557 | * @param status Set if this is a MIXED unit or if another error occurs. |
| 558 | * @return The reciprocal of the target unit. |
| 559 | * @stable ICU 67 |
| 560 | */ |
| 561 | MeasureUnit reciprocal(UErrorCode& status) const; |
| 562 | |
| 563 | /** |
| 564 | * Gets the product of this unit with another unit. This is a way to build units from |
| 565 | * constituent parts. |
| 566 | * |
| 567 | * The numerator and denominator are preserved through this operation. |
| 568 | * |
| 569 | * For example, if the receiver is "kilowatt" and the argument is "hour-per-day", then the |
| 570 | * unit "kilowatt-hour-per-day" is returned. |
| 571 | * |
| 572 | * NOTE: Only works on SINGLE and COMPOUND units. If either unit (receiver and argument) is a |
| 573 | * MIXED unit, an error will occur. For more information, see UMeasureUnitComplexity. |
| 574 | * |
| 575 | * @param other The MeasureUnit to multiply with the target. |
| 576 | * @param status Set if this or other is a MIXED unit or if another error occurs. |
| 577 | * @return The product of the target unit with the provided unit. |
| 578 | * @stable ICU 67 |
| 579 | */ |
| 580 | MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const; |
| 581 | |
| 582 | /** |
| 583 | * Gets the list of SINGLE units contained within a MIXED or COMPOUND unit. |
| 584 | * |
| 585 | * Examples: |
| 586 | * - Given "meter-kilogram-per-second", three units will be returned: "meter", |
| 587 | * "kilogram", and "per-second". |
| 588 | * - Given "hour+minute+second", three units will be returned: "hour", "minute", |
| 589 | * and "second". |
| 590 | * |
| 591 | * If this is a SINGLE unit, an array of length 1 will be returned. |
| 592 | * |
| 593 | * @param status Set if an error occurs. |
| 594 | * @return A pair with the list of units as a LocalArray and the number of units in the list. |
| 595 | * @stable ICU 68 |
| 596 | */ |
| 597 | inline std::pair<LocalArray<MeasureUnit>, int32_t> splitToSingleUnits(UErrorCode& status) const; |
| 598 | |
| 599 | /** |
| 600 | * getAvailable gets all of the available units. |
| 601 | * If there are too many units to fit into destCapacity then the |
| 602 | * error code is set to U_BUFFER_OVERFLOW_ERROR. |
| 603 | * |
| 604 | * @param destArray destination buffer. |
| 605 | * @param destCapacity number of MeasureUnit instances available at dest. |
| 606 | * @param errorCode ICU error code. |
| 607 | * @return number of available units. |
| 608 | * @stable ICU 53 |
| 609 | */ |
| 610 | static int32_t getAvailable( |
| 611 | MeasureUnit *destArray, |
| 612 | int32_t destCapacity, |
| 613 | UErrorCode &errorCode); |
| 614 | |
| 615 | /** |
| 616 | * getAvailable gets all of the available units for a specific type. |
| 617 | * If there are too many units to fit into destCapacity then the |
| 618 | * error code is set to U_BUFFER_OVERFLOW_ERROR. |
| 619 | * |
| 620 | * @param type the type |
| 621 | * @param destArray destination buffer. |
| 622 | * @param destCapacity number of MeasureUnit instances available at dest. |
| 623 | * @param errorCode ICU error code. |
| 624 | * @return number of available units for type. |
| 625 | * @stable ICU 53 |
| 626 | */ |
| 627 | static int32_t getAvailable( |
| 628 | const char *type, |
| 629 | MeasureUnit *destArray, |
| 630 | int32_t destCapacity, |
| 631 | UErrorCode &errorCode); |
| 632 | |
| 633 | /** |
| 634 | * getAvailableTypes gets all of the available types. Caller owns the |
| 635 | * returned StringEnumeration and must delete it when finished using it. |
| 636 | * |
| 637 | * @param errorCode ICU error code. |
| 638 | * @return the types. |
| 639 | * @stable ICU 53 |
| 640 | */ |
| 641 | static StringEnumeration* getAvailableTypes(UErrorCode &errorCode); |
| 642 | |
| 643 | /** |
| 644 | * Return the class ID for this class. This is useful only for comparing to |
| 645 | * a return value from getDynamicClassID(). For example: |
| 646 | * <pre> |
| 647 | * . Base* polymorphic_pointer = createPolymorphicObject(); |
| 648 | * . if (polymorphic_pointer->getDynamicClassID() == |
| 649 | * . Derived::getStaticClassID()) ... |
| 650 | * </pre> |
| 651 | * @return The class ID for all objects of this class. |
| 652 | * @stable ICU 53 |
| 653 | */ |
| 654 | static UClassID U_EXPORT2 getStaticClassID(void); |
| 655 | |
| 656 | /** |
| 657 | * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This |
| 658 | * method is to implement a simple version of RTTI, since not all C++ |
| 659 | * compilers support genuine RTTI. Polymorphic operator==() and clone() |
| 660 | * methods call this method. |
| 661 | * |
| 662 | * @return The class ID for this object. All objects of a |
| 663 | * given class have the same class ID. Objects of |
| 664 | * other classes have different class IDs. |
| 665 | * @stable ICU 53 |
| 666 | */ |
| 667 | virtual UClassID getDynamicClassID(void) const override; |
| 668 | |
| 669 | #ifndef U_HIDE_INTERNAL_API |
| 670 | /** |
| 671 | * ICU use only. |
| 672 | * Returns associated array index for this measure unit. |
| 673 | * @internal |
| 674 | */ |
| 675 | int32_t getOffset() const; |
| 676 | #endif /* U_HIDE_INTERNAL_API */ |
| 677 | |
| 678 | // All code between the "Start generated createXXX methods" comment and |
| 679 | // the "End generated createXXX methods" comment is auto generated code |
| 680 | // and must not be edited manually. For instructions on how to correctly |
| 681 | // update this code, refer to: |
| 682 | // docs/processes/release/tasks/updating-measure-unit.md |
| 683 | // |
| 684 | // Start generated createXXX methods |
| 685 | |
| 686 | /** |
| 687 | * Returns by pointer, unit of acceleration: g-force. |
| 688 | * Caller owns returned value and must free it. |
| 689 | * Also see {@link #getGForce()}. |
| 690 | * @param status ICU error code. |
| 691 | * @stable ICU 53 |
| 692 | */ |
| 693 | static MeasureUnit *createGForce(UErrorCode &status); |
| 694 | |
| 695 | /** |
| 696 | * Returns by value, unit of acceleration: g-force. |
| 697 | * Also see {@link #createGForce()}. |
| 698 | * @stable ICU 64 |
| 699 | */ |
| 700 | static MeasureUnit getGForce(); |
| 701 | |
| 702 | /** |
| 703 | * Returns by pointer, unit of acceleration: meter-per-square-second. |
| 704 | * Caller owns returned value and must free it. |
| 705 | * Also see {@link #getMeterPerSecondSquared()}. |
| 706 | * @param status ICU error code. |
| 707 | * @stable ICU 54 |
| 708 | */ |
| 709 | static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status); |
| 710 | |
| 711 | /** |
| 712 | * Returns by value, unit of acceleration: meter-per-square-second. |
| 713 | * Also see {@link #createMeterPerSecondSquared()}. |
| 714 | * @stable ICU 64 |
| 715 | */ |
| 716 | static MeasureUnit getMeterPerSecondSquared(); |
| 717 | |
| 718 | /** |
| 719 | * Returns by pointer, unit of angle: arc-minute. |
| 720 | * Caller owns returned value and must free it. |
| 721 | * Also see {@link #getArcMinute()}. |
| 722 | * @param status ICU error code. |
| 723 | * @stable ICU 53 |
| 724 | */ |
| 725 | static MeasureUnit *createArcMinute(UErrorCode &status); |
| 726 | |
| 727 | /** |
| 728 | * Returns by value, unit of angle: arc-minute. |
| 729 | * Also see {@link #createArcMinute()}. |
| 730 | * @stable ICU 64 |
| 731 | */ |
| 732 | static MeasureUnit getArcMinute(); |
| 733 | |
| 734 | /** |
| 735 | * Returns by pointer, unit of angle: arc-second. |
| 736 | * Caller owns returned value and must free it. |
| 737 | * Also see {@link #getArcSecond()}. |
| 738 | * @param status ICU error code. |
| 739 | * @stable ICU 53 |
| 740 | */ |
| 741 | static MeasureUnit *createArcSecond(UErrorCode &status); |
| 742 | |
| 743 | /** |
| 744 | * Returns by value, unit of angle: arc-second. |
| 745 | * Also see {@link #createArcSecond()}. |
| 746 | * @stable ICU 64 |
| 747 | */ |
| 748 | static MeasureUnit getArcSecond(); |
| 749 | |
| 750 | /** |
| 751 | * Returns by pointer, unit of angle: degree. |
| 752 | * Caller owns returned value and must free it. |
| 753 | * Also see {@link #getDegree()}. |
| 754 | * @param status ICU error code. |
| 755 | * @stable ICU 53 |
| 756 | */ |
| 757 | static MeasureUnit *createDegree(UErrorCode &status); |
| 758 | |
| 759 | /** |
| 760 | * Returns by value, unit of angle: degree. |
| 761 | * Also see {@link #createDegree()}. |
| 762 | * @stable ICU 64 |
| 763 | */ |
| 764 | static MeasureUnit getDegree(); |
| 765 | |
| 766 | /** |
| 767 | * Returns by pointer, unit of angle: radian. |
| 768 | * Caller owns returned value and must free it. |
| 769 | * Also see {@link #getRadian()}. |
| 770 | * @param status ICU error code. |
| 771 | * @stable ICU 54 |
| 772 | */ |
| 773 | static MeasureUnit *createRadian(UErrorCode &status); |
| 774 | |
| 775 | /** |
| 776 | * Returns by value, unit of angle: radian. |
| 777 | * Also see {@link #createRadian()}. |
| 778 | * @stable ICU 64 |
| 779 | */ |
| 780 | static MeasureUnit getRadian(); |
| 781 | |
| 782 | /** |
| 783 | * Returns by pointer, unit of angle: revolution. |
| 784 | * Caller owns returned value and must free it. |
| 785 | * Also see {@link #getRevolutionAngle()}. |
| 786 | * @param status ICU error code. |
| 787 | * @stable ICU 56 |
| 788 | */ |
| 789 | static MeasureUnit *createRevolutionAngle(UErrorCode &status); |
| 790 | |
| 791 | /** |
| 792 | * Returns by value, unit of angle: revolution. |
| 793 | * Also see {@link #createRevolutionAngle()}. |
| 794 | * @stable ICU 64 |
| 795 | */ |
| 796 | static MeasureUnit getRevolutionAngle(); |
| 797 | |
| 798 | /** |
| 799 | * Returns by pointer, unit of area: acre. |
| 800 | * Caller owns returned value and must free it. |
| 801 | * Also see {@link #getAcre()}. |
| 802 | * @param status ICU error code. |
| 803 | * @stable ICU 53 |
| 804 | */ |
| 805 | static MeasureUnit *createAcre(UErrorCode &status); |
| 806 | |
| 807 | /** |
| 808 | * Returns by value, unit of area: acre. |
| 809 | * Also see {@link #createAcre()}. |
| 810 | * @stable ICU 64 |
| 811 | */ |
| 812 | static MeasureUnit getAcre(); |
| 813 | |
| 814 | /** |
| 815 | * Returns by pointer, unit of area: dunam. |
| 816 | * Caller owns returned value and must free it. |
| 817 | * Also see {@link #getDunam()}. |
| 818 | * @param status ICU error code. |
| 819 | * @stable ICU 64 |
| 820 | */ |
| 821 | static MeasureUnit *createDunam(UErrorCode &status); |
| 822 | |
| 823 | /** |
| 824 | * Returns by value, unit of area: dunam. |
| 825 | * Also see {@link #createDunam()}. |
| 826 | * @stable ICU 64 |
| 827 | */ |
| 828 | static MeasureUnit getDunam(); |
| 829 | |
| 830 | /** |
| 831 | * Returns by pointer, unit of area: hectare. |
| 832 | * Caller owns returned value and must free it. |
| 833 | * Also see {@link #getHectare()}. |
| 834 | * @param status ICU error code. |
| 835 | * @stable ICU 53 |
| 836 | */ |
| 837 | static MeasureUnit *createHectare(UErrorCode &status); |
| 838 | |
| 839 | /** |
| 840 | * Returns by value, unit of area: hectare. |
| 841 | * Also see {@link #createHectare()}. |
| 842 | * @stable ICU 64 |
| 843 | */ |
| 844 | static MeasureUnit getHectare(); |
| 845 | |
| 846 | /** |
| 847 | * Returns by pointer, unit of area: square-centimeter. |
| 848 | * Caller owns returned value and must free it. |
| 849 | * Also see {@link #getSquareCentimeter()}. |
| 850 | * @param status ICU error code. |
| 851 | * @stable ICU 54 |
| 852 | */ |
| 853 | static MeasureUnit *createSquareCentimeter(UErrorCode &status); |
| 854 | |
| 855 | /** |
| 856 | * Returns by value, unit of area: square-centimeter. |
| 857 | * Also see {@link #createSquareCentimeter()}. |
| 858 | * @stable ICU 64 |
| 859 | */ |
| 860 | static MeasureUnit getSquareCentimeter(); |
| 861 | |
| 862 | /** |
| 863 | * Returns by pointer, unit of area: square-foot. |
| 864 | * Caller owns returned value and must free it. |
| 865 | * Also see {@link #getSquareFoot()}. |
| 866 | * @param status ICU error code. |
| 867 | * @stable ICU 53 |
| 868 | */ |
| 869 | static MeasureUnit *(UErrorCode &status); |
| 870 | |
| 871 | /** |
| 872 | * Returns by value, unit of area: square-foot. |
| 873 | * Also see {@link #createSquareFoot()}. |
| 874 | * @stable ICU 64 |
| 875 | */ |
| 876 | static MeasureUnit (); |
| 877 | |
| 878 | /** |
| 879 | * Returns by pointer, unit of area: square-inch. |
| 880 | * Caller owns returned value and must free it. |
| 881 | * Also see {@link #getSquareInch()}. |
| 882 | * @param status ICU error code. |
| 883 | * @stable ICU 54 |
| 884 | */ |
| 885 | static MeasureUnit *createSquareInch(UErrorCode &status); |
| 886 | |
| 887 | /** |
| 888 | * Returns by value, unit of area: square-inch. |
| 889 | * Also see {@link #createSquareInch()}. |
| 890 | * @stable ICU 64 |
| 891 | */ |
| 892 | static MeasureUnit getSquareInch(); |
| 893 | |
| 894 | /** |
| 895 | * Returns by pointer, unit of area: square-kilometer. |
| 896 | * Caller owns returned value and must free it. |
| 897 | * Also see {@link #getSquareKilometer()}. |
| 898 | * @param status ICU error code. |
| 899 | * @stable ICU 53 |
| 900 | */ |
| 901 | static MeasureUnit *createSquareKilometer(UErrorCode &status); |
| 902 | |
| 903 | /** |
| 904 | * Returns by value, unit of area: square-kilometer. |
| 905 | * Also see {@link #createSquareKilometer()}. |
| 906 | * @stable ICU 64 |
| 907 | */ |
| 908 | static MeasureUnit getSquareKilometer(); |
| 909 | |
| 910 | /** |
| 911 | * Returns by pointer, unit of area: square-meter. |
| 912 | * Caller owns returned value and must free it. |
| 913 | * Also see {@link #getSquareMeter()}. |
| 914 | * @param status ICU error code. |
| 915 | * @stable ICU 53 |
| 916 | */ |
| 917 | static MeasureUnit *createSquareMeter(UErrorCode &status); |
| 918 | |
| 919 | /** |
| 920 | * Returns by value, unit of area: square-meter. |
| 921 | * Also see {@link #createSquareMeter()}. |
| 922 | * @stable ICU 64 |
| 923 | */ |
| 924 | static MeasureUnit getSquareMeter(); |
| 925 | |
| 926 | /** |
| 927 | * Returns by pointer, unit of area: square-mile. |
| 928 | * Caller owns returned value and must free it. |
| 929 | * Also see {@link #getSquareMile()}. |
| 930 | * @param status ICU error code. |
| 931 | * @stable ICU 53 |
| 932 | */ |
| 933 | static MeasureUnit *createSquareMile(UErrorCode &status); |
| 934 | |
| 935 | /** |
| 936 | * Returns by value, unit of area: square-mile. |
| 937 | * Also see {@link #createSquareMile()}. |
| 938 | * @stable ICU 64 |
| 939 | */ |
| 940 | static MeasureUnit getSquareMile(); |
| 941 | |
| 942 | /** |
| 943 | * Returns by pointer, unit of area: square-yard. |
| 944 | * Caller owns returned value and must free it. |
| 945 | * Also see {@link #getSquareYard()}. |
| 946 | * @param status ICU error code. |
| 947 | * @stable ICU 54 |
| 948 | */ |
| 949 | static MeasureUnit *createSquareYard(UErrorCode &status); |
| 950 | |
| 951 | /** |
| 952 | * Returns by value, unit of area: square-yard. |
| 953 | * Also see {@link #createSquareYard()}. |
| 954 | * @stable ICU 64 |
| 955 | */ |
| 956 | static MeasureUnit getSquareYard(); |
| 957 | |
| 958 | #ifndef U_HIDE_DRAFT_API |
| 959 | /** |
| 960 | * Returns by pointer, unit of concentr: item. |
| 961 | * Caller owns returned value and must free it. |
| 962 | * Also see {@link #getItem()}. |
| 963 | * @param status ICU error code. |
| 964 | * @draft ICU 70 |
| 965 | */ |
| 966 | static MeasureUnit *createItem(UErrorCode &status); |
| 967 | |
| 968 | /** |
| 969 | * Returns by value, unit of concentr: item. |
| 970 | * Also see {@link #createItem()}. |
| 971 | * @draft ICU 70 |
| 972 | */ |
| 973 | static MeasureUnit getItem(); |
| 974 | #endif /* U_HIDE_DRAFT_API */ |
| 975 | |
| 976 | /** |
| 977 | * Returns by pointer, unit of concentr: karat. |
| 978 | * Caller owns returned value and must free it. |
| 979 | * Also see {@link #getKarat()}. |
| 980 | * @param status ICU error code. |
| 981 | * @stable ICU 54 |
| 982 | */ |
| 983 | static MeasureUnit *createKarat(UErrorCode &status); |
| 984 | |
| 985 | /** |
| 986 | * Returns by value, unit of concentr: karat. |
| 987 | * Also see {@link #createKarat()}. |
| 988 | * @stable ICU 64 |
| 989 | */ |
| 990 | static MeasureUnit getKarat(); |
| 991 | |
| 992 | #ifndef U_HIDE_DRAFT_API |
| 993 | /** |
| 994 | * Returns by pointer, unit of concentr: milligram-ofglucose-per-deciliter. |
| 995 | * Caller owns returned value and must free it. |
| 996 | * Also see {@link #getMilligramOfglucosePerDeciliter()}. |
| 997 | * @param status ICU error code. |
| 998 | * @draft ICU 69 |
| 999 | */ |
| 1000 | static MeasureUnit *createMilligramOfglucosePerDeciliter(UErrorCode &status); |
| 1001 | |
| 1002 | /** |
| 1003 | * Returns by value, unit of concentr: milligram-ofglucose-per-deciliter. |
| 1004 | * Also see {@link #createMilligramOfglucosePerDeciliter()}. |
| 1005 | * @draft ICU 69 |
| 1006 | */ |
| 1007 | static MeasureUnit getMilligramOfglucosePerDeciliter(); |
| 1008 | #endif /* U_HIDE_DRAFT_API */ |
| 1009 | |
| 1010 | /** |
| 1011 | * Returns by pointer, unit of concentr: milligram-per-deciliter. |
| 1012 | * Caller owns returned value and must free it. |
| 1013 | * Also see {@link #getMilligramPerDeciliter()}. |
| 1014 | * @param status ICU error code. |
| 1015 | * @stable ICU 57 |
| 1016 | */ |
| 1017 | static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status); |
| 1018 | |
| 1019 | /** |
| 1020 | * Returns by value, unit of concentr: milligram-per-deciliter. |
| 1021 | * Also see {@link #createMilligramPerDeciliter()}. |
| 1022 | * @stable ICU 64 |
| 1023 | */ |
| 1024 | static MeasureUnit getMilligramPerDeciliter(); |
| 1025 | |
| 1026 | /** |
| 1027 | * Returns by pointer, unit of concentr: millimole-per-liter. |
| 1028 | * Caller owns returned value and must free it. |
| 1029 | * Also see {@link #getMillimolePerLiter()}. |
| 1030 | * @param status ICU error code. |
| 1031 | * @stable ICU 57 |
| 1032 | */ |
| 1033 | static MeasureUnit *createMillimolePerLiter(UErrorCode &status); |
| 1034 | |
| 1035 | /** |
| 1036 | * Returns by value, unit of concentr: millimole-per-liter. |
| 1037 | * Also see {@link #createMillimolePerLiter()}. |
| 1038 | * @stable ICU 64 |
| 1039 | */ |
| 1040 | static MeasureUnit getMillimolePerLiter(); |
| 1041 | |
| 1042 | /** |
| 1043 | * Returns by pointer, unit of concentr: mole. |
| 1044 | * Caller owns returned value and must free it. |
| 1045 | * Also see {@link #getMole()}. |
| 1046 | * @param status ICU error code. |
| 1047 | * @stable ICU 64 |
| 1048 | */ |
| 1049 | static MeasureUnit *createMole(UErrorCode &status); |
| 1050 | |
| 1051 | /** |
| 1052 | * Returns by value, unit of concentr: mole. |
| 1053 | * Also see {@link #createMole()}. |
| 1054 | * @stable ICU 64 |
| 1055 | */ |
| 1056 | static MeasureUnit getMole(); |
| 1057 | |
| 1058 | /** |
| 1059 | * Returns by pointer, unit of concentr: percent. |
| 1060 | * Caller owns returned value and must free it. |
| 1061 | * Also see {@link #getPercent()}. |
| 1062 | * @param status ICU error code. |
| 1063 | * @stable ICU 63 |
| 1064 | */ |
| 1065 | static MeasureUnit *createPercent(UErrorCode &status); |
| 1066 | |
| 1067 | /** |
| 1068 | * Returns by value, unit of concentr: percent. |
| 1069 | * Also see {@link #createPercent()}. |
| 1070 | * @stable ICU 64 |
| 1071 | */ |
| 1072 | static MeasureUnit getPercent(); |
| 1073 | |
| 1074 | /** |
| 1075 | * Returns by pointer, unit of concentr: permille. |
| 1076 | * Caller owns returned value and must free it. |
| 1077 | * Also see {@link #getPermille()}. |
| 1078 | * @param status ICU error code. |
| 1079 | * @stable ICU 63 |
| 1080 | */ |
| 1081 | static MeasureUnit *createPermille(UErrorCode &status); |
| 1082 | |
| 1083 | /** |
| 1084 | * Returns by value, unit of concentr: permille. |
| 1085 | * Also see {@link #createPermille()}. |
| 1086 | * @stable ICU 64 |
| 1087 | */ |
| 1088 | static MeasureUnit getPermille(); |
| 1089 | |
| 1090 | /** |
| 1091 | * Returns by pointer, unit of concentr: permillion. |
| 1092 | * Caller owns returned value and must free it. |
| 1093 | * Also see {@link #getPartPerMillion()}. |
| 1094 | * @param status ICU error code. |
| 1095 | * @stable ICU 57 |
| 1096 | */ |
| 1097 | static MeasureUnit *createPartPerMillion(UErrorCode &status); |
| 1098 | |
| 1099 | /** |
| 1100 | * Returns by value, unit of concentr: permillion. |
| 1101 | * Also see {@link #createPartPerMillion()}. |
| 1102 | * @stable ICU 64 |
| 1103 | */ |
| 1104 | static MeasureUnit getPartPerMillion(); |
| 1105 | |
| 1106 | /** |
| 1107 | * Returns by pointer, unit of concentr: permyriad. |
| 1108 | * Caller owns returned value and must free it. |
| 1109 | * Also see {@link #getPermyriad()}. |
| 1110 | * @param status ICU error code. |
| 1111 | * @stable ICU 64 |
| 1112 | */ |
| 1113 | static MeasureUnit *createPermyriad(UErrorCode &status); |
| 1114 | |
| 1115 | /** |
| 1116 | * Returns by value, unit of concentr: permyriad. |
| 1117 | * Also see {@link #createPermyriad()}. |
| 1118 | * @stable ICU 64 |
| 1119 | */ |
| 1120 | static MeasureUnit getPermyriad(); |
| 1121 | |
| 1122 | /** |
| 1123 | * Returns by pointer, unit of consumption: liter-per-100-kilometer. |
| 1124 | * Caller owns returned value and must free it. |
| 1125 | * Also see {@link #getLiterPer100Kilometers()}. |
| 1126 | * @param status ICU error code. |
| 1127 | * @stable ICU 56 |
| 1128 | */ |
| 1129 | static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status); |
| 1130 | |
| 1131 | /** |
| 1132 | * Returns by value, unit of consumption: liter-per-100-kilometer. |
| 1133 | * Also see {@link #createLiterPer100Kilometers()}. |
| 1134 | * @stable ICU 64 |
| 1135 | */ |
| 1136 | static MeasureUnit getLiterPer100Kilometers(); |
| 1137 | |
| 1138 | /** |
| 1139 | * Returns by pointer, unit of consumption: liter-per-kilometer. |
| 1140 | * Caller owns returned value and must free it. |
| 1141 | * Also see {@link #getLiterPerKilometer()}. |
| 1142 | * @param status ICU error code. |
| 1143 | * @stable ICU 54 |
| 1144 | */ |
| 1145 | static MeasureUnit *createLiterPerKilometer(UErrorCode &status); |
| 1146 | |
| 1147 | /** |
| 1148 | * Returns by value, unit of consumption: liter-per-kilometer. |
| 1149 | * Also see {@link #createLiterPerKilometer()}. |
| 1150 | * @stable ICU 64 |
| 1151 | */ |
| 1152 | static MeasureUnit getLiterPerKilometer(); |
| 1153 | |
| 1154 | /** |
| 1155 | * Returns by pointer, unit of consumption: mile-per-gallon. |
| 1156 | * Caller owns returned value and must free it. |
| 1157 | * Also see {@link #getMilePerGallon()}. |
| 1158 | * @param status ICU error code. |
| 1159 | * @stable ICU 54 |
| 1160 | */ |
| 1161 | static MeasureUnit *createMilePerGallon(UErrorCode &status); |
| 1162 | |
| 1163 | /** |
| 1164 | * Returns by value, unit of consumption: mile-per-gallon. |
| 1165 | * Also see {@link #createMilePerGallon()}. |
| 1166 | * @stable ICU 64 |
| 1167 | */ |
| 1168 | static MeasureUnit getMilePerGallon(); |
| 1169 | |
| 1170 | /** |
| 1171 | * Returns by pointer, unit of consumption: mile-per-gallon-imperial. |
| 1172 | * Caller owns returned value and must free it. |
| 1173 | * Also see {@link #getMilePerGallonImperial()}. |
| 1174 | * @param status ICU error code. |
| 1175 | * @stable ICU 57 |
| 1176 | */ |
| 1177 | static MeasureUnit *createMilePerGallonImperial(UErrorCode &status); |
| 1178 | |
| 1179 | /** |
| 1180 | * Returns by value, unit of consumption: mile-per-gallon-imperial. |
| 1181 | * Also see {@link #createMilePerGallonImperial()}. |
| 1182 | * @stable ICU 64 |
| 1183 | */ |
| 1184 | static MeasureUnit getMilePerGallonImperial(); |
| 1185 | |
| 1186 | /** |
| 1187 | * Returns by pointer, unit of digital: bit. |
| 1188 | * Caller owns returned value and must free it. |
| 1189 | * Also see {@link #getBit()}. |
| 1190 | * @param status ICU error code. |
| 1191 | * @stable ICU 54 |
| 1192 | */ |
| 1193 | static MeasureUnit *createBit(UErrorCode &status); |
| 1194 | |
| 1195 | /** |
| 1196 | * Returns by value, unit of digital: bit. |
| 1197 | * Also see {@link #createBit()}. |
| 1198 | * @stable ICU 64 |
| 1199 | */ |
| 1200 | static MeasureUnit getBit(); |
| 1201 | |
| 1202 | /** |
| 1203 | * Returns by pointer, unit of digital: byte. |
| 1204 | * Caller owns returned value and must free it. |
| 1205 | * Also see {@link #getByte()}. |
| 1206 | * @param status ICU error code. |
| 1207 | * @stable ICU 54 |
| 1208 | */ |
| 1209 | static MeasureUnit *createByte(UErrorCode &status); |
| 1210 | |
| 1211 | /** |
| 1212 | * Returns by value, unit of digital: byte. |
| 1213 | * Also see {@link #createByte()}. |
| 1214 | * @stable ICU 64 |
| 1215 | */ |
| 1216 | static MeasureUnit getByte(); |
| 1217 | |
| 1218 | /** |
| 1219 | * Returns by pointer, unit of digital: gigabit. |
| 1220 | * Caller owns returned value and must free it. |
| 1221 | * Also see {@link #getGigabit()}. |
| 1222 | * @param status ICU error code. |
| 1223 | * @stable ICU 54 |
| 1224 | */ |
| 1225 | static MeasureUnit *createGigabit(UErrorCode &status); |
| 1226 | |
| 1227 | /** |
| 1228 | * Returns by value, unit of digital: gigabit. |
| 1229 | * Also see {@link #createGigabit()}. |
| 1230 | * @stable ICU 64 |
| 1231 | */ |
| 1232 | static MeasureUnit getGigabit(); |
| 1233 | |
| 1234 | /** |
| 1235 | * Returns by pointer, unit of digital: gigabyte. |
| 1236 | * Caller owns returned value and must free it. |
| 1237 | * Also see {@link #getGigabyte()}. |
| 1238 | * @param status ICU error code. |
| 1239 | * @stable ICU 54 |
| 1240 | */ |
| 1241 | static MeasureUnit *createGigabyte(UErrorCode &status); |
| 1242 | |
| 1243 | /** |
| 1244 | * Returns by value, unit of digital: gigabyte. |
| 1245 | * Also see {@link #createGigabyte()}. |
| 1246 | * @stable ICU 64 |
| 1247 | */ |
| 1248 | static MeasureUnit getGigabyte(); |
| 1249 | |
| 1250 | /** |
| 1251 | * Returns by pointer, unit of digital: kilobit. |
| 1252 | * Caller owns returned value and must free it. |
| 1253 | * Also see {@link #getKilobit()}. |
| 1254 | * @param status ICU error code. |
| 1255 | * @stable ICU 54 |
| 1256 | */ |
| 1257 | static MeasureUnit *createKilobit(UErrorCode &status); |
| 1258 | |
| 1259 | /** |
| 1260 | * Returns by value, unit of digital: kilobit. |
| 1261 | * Also see {@link #createKilobit()}. |
| 1262 | * @stable ICU 64 |
| 1263 | */ |
| 1264 | static MeasureUnit getKilobit(); |
| 1265 | |
| 1266 | /** |
| 1267 | * Returns by pointer, unit of digital: kilobyte. |
| 1268 | * Caller owns returned value and must free it. |
| 1269 | * Also see {@link #getKilobyte()}. |
| 1270 | * @param status ICU error code. |
| 1271 | * @stable ICU 54 |
| 1272 | */ |
| 1273 | static MeasureUnit *createKilobyte(UErrorCode &status); |
| 1274 | |
| 1275 | /** |
| 1276 | * Returns by value, unit of digital: kilobyte. |
| 1277 | * Also see {@link #createKilobyte()}. |
| 1278 | * @stable ICU 64 |
| 1279 | */ |
| 1280 | static MeasureUnit getKilobyte(); |
| 1281 | |
| 1282 | /** |
| 1283 | * Returns by pointer, unit of digital: megabit. |
| 1284 | * Caller owns returned value and must free it. |
| 1285 | * Also see {@link #getMegabit()}. |
| 1286 | * @param status ICU error code. |
| 1287 | * @stable ICU 54 |
| 1288 | */ |
| 1289 | static MeasureUnit *createMegabit(UErrorCode &status); |
| 1290 | |
| 1291 | /** |
| 1292 | * Returns by value, unit of digital: megabit. |
| 1293 | * Also see {@link #createMegabit()}. |
| 1294 | * @stable ICU 64 |
| 1295 | */ |
| 1296 | static MeasureUnit getMegabit(); |
| 1297 | |
| 1298 | /** |
| 1299 | * Returns by pointer, unit of digital: megabyte. |
| 1300 | * Caller owns returned value and must free it. |
| 1301 | * Also see {@link #getMegabyte()}. |
| 1302 | * @param status ICU error code. |
| 1303 | * @stable ICU 54 |
| 1304 | */ |
| 1305 | static MeasureUnit *createMegabyte(UErrorCode &status); |
| 1306 | |
| 1307 | /** |
| 1308 | * Returns by value, unit of digital: megabyte. |
| 1309 | * Also see {@link #createMegabyte()}. |
| 1310 | * @stable ICU 64 |
| 1311 | */ |
| 1312 | static MeasureUnit getMegabyte(); |
| 1313 | |
| 1314 | /** |
| 1315 | * Returns by pointer, unit of digital: petabyte. |
| 1316 | * Caller owns returned value and must free it. |
| 1317 | * Also see {@link #getPetabyte()}. |
| 1318 | * @param status ICU error code. |
| 1319 | * @stable ICU 63 |
| 1320 | */ |
| 1321 | static MeasureUnit *createPetabyte(UErrorCode &status); |
| 1322 | |
| 1323 | /** |
| 1324 | * Returns by value, unit of digital: petabyte. |
| 1325 | * Also see {@link #createPetabyte()}. |
| 1326 | * @stable ICU 64 |
| 1327 | */ |
| 1328 | static MeasureUnit getPetabyte(); |
| 1329 | |
| 1330 | /** |
| 1331 | * Returns by pointer, unit of digital: terabit. |
| 1332 | * Caller owns returned value and must free it. |
| 1333 | * Also see {@link #getTerabit()}. |
| 1334 | * @param status ICU error code. |
| 1335 | * @stable ICU 54 |
| 1336 | */ |
| 1337 | static MeasureUnit *createTerabit(UErrorCode &status); |
| 1338 | |
| 1339 | /** |
| 1340 | * Returns by value, unit of digital: terabit. |
| 1341 | * Also see {@link #createTerabit()}. |
| 1342 | * @stable ICU 64 |
| 1343 | */ |
| 1344 | static MeasureUnit getTerabit(); |
| 1345 | |
| 1346 | /** |
| 1347 | * Returns by pointer, unit of digital: terabyte. |
| 1348 | * Caller owns returned value and must free it. |
| 1349 | * Also see {@link #getTerabyte()}. |
| 1350 | * @param status ICU error code. |
| 1351 | * @stable ICU 54 |
| 1352 | */ |
| 1353 | static MeasureUnit *createTerabyte(UErrorCode &status); |
| 1354 | |
| 1355 | /** |
| 1356 | * Returns by value, unit of digital: terabyte. |
| 1357 | * Also see {@link #createTerabyte()}. |
| 1358 | * @stable ICU 64 |
| 1359 | */ |
| 1360 | static MeasureUnit getTerabyte(); |
| 1361 | |
| 1362 | /** |
| 1363 | * Returns by pointer, unit of duration: century. |
| 1364 | * Caller owns returned value and must free it. |
| 1365 | * Also see {@link #getCentury()}. |
| 1366 | * @param status ICU error code. |
| 1367 | * @stable ICU 56 |
| 1368 | */ |
| 1369 | static MeasureUnit *createCentury(UErrorCode &status); |
| 1370 | |
| 1371 | /** |
| 1372 | * Returns by value, unit of duration: century. |
| 1373 | * Also see {@link #createCentury()}. |
| 1374 | * @stable ICU 64 |
| 1375 | */ |
| 1376 | static MeasureUnit getCentury(); |
| 1377 | |
| 1378 | /** |
| 1379 | * Returns by pointer, unit of duration: day. |
| 1380 | * Caller owns returned value and must free it. |
| 1381 | * Also see {@link #getDay()}. |
| 1382 | * @param status ICU error code. |
| 1383 | * @stable ICU 53 |
| 1384 | */ |
| 1385 | static MeasureUnit *createDay(UErrorCode &status); |
| 1386 | |
| 1387 | /** |
| 1388 | * Returns by value, unit of duration: day. |
| 1389 | * Also see {@link #createDay()}. |
| 1390 | * @stable ICU 64 |
| 1391 | */ |
| 1392 | static MeasureUnit getDay(); |
| 1393 | |
| 1394 | /** |
| 1395 | * Returns by pointer, unit of duration: day-person. |
| 1396 | * Caller owns returned value and must free it. |
| 1397 | * Also see {@link #getDayPerson()}. |
| 1398 | * @param status ICU error code. |
| 1399 | * @stable ICU 64 |
| 1400 | */ |
| 1401 | static MeasureUnit *createDayPerson(UErrorCode &status); |
| 1402 | |
| 1403 | /** |
| 1404 | * Returns by value, unit of duration: day-person. |
| 1405 | * Also see {@link #createDayPerson()}. |
| 1406 | * @stable ICU 64 |
| 1407 | */ |
| 1408 | static MeasureUnit getDayPerson(); |
| 1409 | |
| 1410 | /** |
| 1411 | * Returns by pointer, unit of duration: decade. |
| 1412 | * Caller owns returned value and must free it. |
| 1413 | * Also see {@link #getDecade()}. |
| 1414 | * @param status ICU error code. |
| 1415 | * @stable ICU 65 |
| 1416 | */ |
| 1417 | static MeasureUnit *createDecade(UErrorCode &status); |
| 1418 | |
| 1419 | /** |
| 1420 | * Returns by value, unit of duration: decade. |
| 1421 | * Also see {@link #createDecade()}. |
| 1422 | * @stable ICU 65 |
| 1423 | */ |
| 1424 | static MeasureUnit getDecade(); |
| 1425 | |
| 1426 | /** |
| 1427 | * Returns by pointer, unit of duration: hour. |
| 1428 | * Caller owns returned value and must free it. |
| 1429 | * Also see {@link #getHour()}. |
| 1430 | * @param status ICU error code. |
| 1431 | * @stable ICU 53 |
| 1432 | */ |
| 1433 | static MeasureUnit *createHour(UErrorCode &status); |
| 1434 | |
| 1435 | /** |
| 1436 | * Returns by value, unit of duration: hour. |
| 1437 | * Also see {@link #createHour()}. |
| 1438 | * @stable ICU 64 |
| 1439 | */ |
| 1440 | static MeasureUnit getHour(); |
| 1441 | |
| 1442 | /** |
| 1443 | * Returns by pointer, unit of duration: microsecond. |
| 1444 | * Caller owns returned value and must free it. |
| 1445 | * Also see {@link #getMicrosecond()}. |
| 1446 | * @param status ICU error code. |
| 1447 | * @stable ICU 54 |
| 1448 | */ |
| 1449 | static MeasureUnit *createMicrosecond(UErrorCode &status); |
| 1450 | |
| 1451 | /** |
| 1452 | * Returns by value, unit of duration: microsecond. |
| 1453 | * Also see {@link #createMicrosecond()}. |
| 1454 | * @stable ICU 64 |
| 1455 | */ |
| 1456 | static MeasureUnit getMicrosecond(); |
| 1457 | |
| 1458 | /** |
| 1459 | * Returns by pointer, unit of duration: millisecond. |
| 1460 | * Caller owns returned value and must free it. |
| 1461 | * Also see {@link #getMillisecond()}. |
| 1462 | * @param status ICU error code. |
| 1463 | * @stable ICU 53 |
| 1464 | */ |
| 1465 | static MeasureUnit *createMillisecond(UErrorCode &status); |
| 1466 | |
| 1467 | /** |
| 1468 | * Returns by value, unit of duration: millisecond. |
| 1469 | * Also see {@link #createMillisecond()}. |
| 1470 | * @stable ICU 64 |
| 1471 | */ |
| 1472 | static MeasureUnit getMillisecond(); |
| 1473 | |
| 1474 | /** |
| 1475 | * Returns by pointer, unit of duration: minute. |
| 1476 | * Caller owns returned value and must free it. |
| 1477 | * Also see {@link #getMinute()}. |
| 1478 | * @param status ICU error code. |
| 1479 | * @stable ICU 53 |
| 1480 | */ |
| 1481 | static MeasureUnit *createMinute(UErrorCode &status); |
| 1482 | |
| 1483 | /** |
| 1484 | * Returns by value, unit of duration: minute. |
| 1485 | * Also see {@link #createMinute()}. |
| 1486 | * @stable ICU 64 |
| 1487 | */ |
| 1488 | static MeasureUnit getMinute(); |
| 1489 | |
| 1490 | /** |
| 1491 | * Returns by pointer, unit of duration: month. |
| 1492 | * Caller owns returned value and must free it. |
| 1493 | * Also see {@link #getMonth()}. |
| 1494 | * @param status ICU error code. |
| 1495 | * @stable ICU 53 |
| 1496 | */ |
| 1497 | static MeasureUnit *createMonth(UErrorCode &status); |
| 1498 | |
| 1499 | /** |
| 1500 | * Returns by value, unit of duration: month. |
| 1501 | * Also see {@link #createMonth()}. |
| 1502 | * @stable ICU 64 |
| 1503 | */ |
| 1504 | static MeasureUnit getMonth(); |
| 1505 | |
| 1506 | /** |
| 1507 | * Returns by pointer, unit of duration: month-person. |
| 1508 | * Caller owns returned value and must free it. |
| 1509 | * Also see {@link #getMonthPerson()}. |
| 1510 | * @param status ICU error code. |
| 1511 | * @stable ICU 64 |
| 1512 | */ |
| 1513 | static MeasureUnit *createMonthPerson(UErrorCode &status); |
| 1514 | |
| 1515 | /** |
| 1516 | * Returns by value, unit of duration: month-person. |
| 1517 | * Also see {@link #createMonthPerson()}. |
| 1518 | * @stable ICU 64 |
| 1519 | */ |
| 1520 | static MeasureUnit getMonthPerson(); |
| 1521 | |
| 1522 | /** |
| 1523 | * Returns by pointer, unit of duration: nanosecond. |
| 1524 | * Caller owns returned value and must free it. |
| 1525 | * Also see {@link #getNanosecond()}. |
| 1526 | * @param status ICU error code. |
| 1527 | * @stable ICU 54 |
| 1528 | */ |
| 1529 | static MeasureUnit *createNanosecond(UErrorCode &status); |
| 1530 | |
| 1531 | /** |
| 1532 | * Returns by value, unit of duration: nanosecond. |
| 1533 | * Also see {@link #createNanosecond()}. |
| 1534 | * @stable ICU 64 |
| 1535 | */ |
| 1536 | static MeasureUnit getNanosecond(); |
| 1537 | |
| 1538 | /** |
| 1539 | * Returns by pointer, unit of duration: second. |
| 1540 | * Caller owns returned value and must free it. |
| 1541 | * Also see {@link #getSecond()}. |
| 1542 | * @param status ICU error code. |
| 1543 | * @stable ICU 53 |
| 1544 | */ |
| 1545 | static MeasureUnit *createSecond(UErrorCode &status); |
| 1546 | |
| 1547 | /** |
| 1548 | * Returns by value, unit of duration: second. |
| 1549 | * Also see {@link #createSecond()}. |
| 1550 | * @stable ICU 64 |
| 1551 | */ |
| 1552 | static MeasureUnit getSecond(); |
| 1553 | |
| 1554 | /** |
| 1555 | * Returns by pointer, unit of duration: week. |
| 1556 | * Caller owns returned value and must free it. |
| 1557 | * Also see {@link #getWeek()}. |
| 1558 | * @param status ICU error code. |
| 1559 | * @stable ICU 53 |
| 1560 | */ |
| 1561 | static MeasureUnit *createWeek(UErrorCode &status); |
| 1562 | |
| 1563 | /** |
| 1564 | * Returns by value, unit of duration: week. |
| 1565 | * Also see {@link #createWeek()}. |
| 1566 | * @stable ICU 64 |
| 1567 | */ |
| 1568 | static MeasureUnit getWeek(); |
| 1569 | |
| 1570 | /** |
| 1571 | * Returns by pointer, unit of duration: week-person. |
| 1572 | * Caller owns returned value and must free it. |
| 1573 | * Also see {@link #getWeekPerson()}. |
| 1574 | * @param status ICU error code. |
| 1575 | * @stable ICU 64 |
| 1576 | */ |
| 1577 | static MeasureUnit *createWeekPerson(UErrorCode &status); |
| 1578 | |
| 1579 | /** |
| 1580 | * Returns by value, unit of duration: week-person. |
| 1581 | * Also see {@link #createWeekPerson()}. |
| 1582 | * @stable ICU 64 |
| 1583 | */ |
| 1584 | static MeasureUnit getWeekPerson(); |
| 1585 | |
| 1586 | /** |
| 1587 | * Returns by pointer, unit of duration: year. |
| 1588 | * Caller owns returned value and must free it. |
| 1589 | * Also see {@link #getYear()}. |
| 1590 | * @param status ICU error code. |
| 1591 | * @stable ICU 53 |
| 1592 | */ |
| 1593 | static MeasureUnit *createYear(UErrorCode &status); |
| 1594 | |
| 1595 | /** |
| 1596 | * Returns by value, unit of duration: year. |
| 1597 | * Also see {@link #createYear()}. |
| 1598 | * @stable ICU 64 |
| 1599 | */ |
| 1600 | static MeasureUnit getYear(); |
| 1601 | |
| 1602 | /** |
| 1603 | * Returns by pointer, unit of duration: year-person. |
| 1604 | * Caller owns returned value and must free it. |
| 1605 | * Also see {@link #getYearPerson()}. |
| 1606 | * @param status ICU error code. |
| 1607 | * @stable ICU 64 |
| 1608 | */ |
| 1609 | static MeasureUnit *createYearPerson(UErrorCode &status); |
| 1610 | |
| 1611 | /** |
| 1612 | * Returns by value, unit of duration: year-person. |
| 1613 | * Also see {@link #createYearPerson()}. |
| 1614 | * @stable ICU 64 |
| 1615 | */ |
| 1616 | static MeasureUnit getYearPerson(); |
| 1617 | |
| 1618 | /** |
| 1619 | * Returns by pointer, unit of electric: ampere. |
| 1620 | * Caller owns returned value and must free it. |
| 1621 | * Also see {@link #getAmpere()}. |
| 1622 | * @param status ICU error code. |
| 1623 | * @stable ICU 54 |
| 1624 | */ |
| 1625 | static MeasureUnit *createAmpere(UErrorCode &status); |
| 1626 | |
| 1627 | /** |
| 1628 | * Returns by value, unit of electric: ampere. |
| 1629 | * Also see {@link #createAmpere()}. |
| 1630 | * @stable ICU 64 |
| 1631 | */ |
| 1632 | static MeasureUnit getAmpere(); |
| 1633 | |
| 1634 | /** |
| 1635 | * Returns by pointer, unit of electric: milliampere. |
| 1636 | * Caller owns returned value and must free it. |
| 1637 | * Also see {@link #getMilliampere()}. |
| 1638 | * @param status ICU error code. |
| 1639 | * @stable ICU 54 |
| 1640 | */ |
| 1641 | static MeasureUnit *createMilliampere(UErrorCode &status); |
| 1642 | |
| 1643 | /** |
| 1644 | * Returns by value, unit of electric: milliampere. |
| 1645 | * Also see {@link #createMilliampere()}. |
| 1646 | * @stable ICU 64 |
| 1647 | */ |
| 1648 | static MeasureUnit getMilliampere(); |
| 1649 | |
| 1650 | /** |
| 1651 | * Returns by pointer, unit of electric: ohm. |
| 1652 | * Caller owns returned value and must free it. |
| 1653 | * Also see {@link #getOhm()}. |
| 1654 | * @param status ICU error code. |
| 1655 | * @stable ICU 54 |
| 1656 | */ |
| 1657 | static MeasureUnit *createOhm(UErrorCode &status); |
| 1658 | |
| 1659 | /** |
| 1660 | * Returns by value, unit of electric: ohm. |
| 1661 | * Also see {@link #createOhm()}. |
| 1662 | * @stable ICU 64 |
| 1663 | */ |
| 1664 | static MeasureUnit getOhm(); |
| 1665 | |
| 1666 | /** |
| 1667 | * Returns by pointer, unit of electric: volt. |
| 1668 | * Caller owns returned value and must free it. |
| 1669 | * Also see {@link #getVolt()}. |
| 1670 | * @param status ICU error code. |
| 1671 | * @stable ICU 54 |
| 1672 | */ |
| 1673 | static MeasureUnit *createVolt(UErrorCode &status); |
| 1674 | |
| 1675 | /** |
| 1676 | * Returns by value, unit of electric: volt. |
| 1677 | * Also see {@link #createVolt()}. |
| 1678 | * @stable ICU 64 |
| 1679 | */ |
| 1680 | static MeasureUnit getVolt(); |
| 1681 | |
| 1682 | /** |
| 1683 | * Returns by pointer, unit of energy: british-thermal-unit. |
| 1684 | * Caller owns returned value and must free it. |
| 1685 | * Also see {@link #getBritishThermalUnit()}. |
| 1686 | * @param status ICU error code. |
| 1687 | * @stable ICU 64 |
| 1688 | */ |
| 1689 | static MeasureUnit *createBritishThermalUnit(UErrorCode &status); |
| 1690 | |
| 1691 | /** |
| 1692 | * Returns by value, unit of energy: british-thermal-unit. |
| 1693 | * Also see {@link #createBritishThermalUnit()}. |
| 1694 | * @stable ICU 64 |
| 1695 | */ |
| 1696 | static MeasureUnit getBritishThermalUnit(); |
| 1697 | |
| 1698 | /** |
| 1699 | * Returns by pointer, unit of energy: calorie. |
| 1700 | * Caller owns returned value and must free it. |
| 1701 | * Also see {@link #getCalorie()}. |
| 1702 | * @param status ICU error code. |
| 1703 | * @stable ICU 54 |
| 1704 | */ |
| 1705 | static MeasureUnit *createCalorie(UErrorCode &status); |
| 1706 | |
| 1707 | /** |
| 1708 | * Returns by value, unit of energy: calorie. |
| 1709 | * Also see {@link #createCalorie()}. |
| 1710 | * @stable ICU 64 |
| 1711 | */ |
| 1712 | static MeasureUnit getCalorie(); |
| 1713 | |
| 1714 | /** |
| 1715 | * Returns by pointer, unit of energy: electronvolt. |
| 1716 | * Caller owns returned value and must free it. |
| 1717 | * Also see {@link #getElectronvolt()}. |
| 1718 | * @param status ICU error code. |
| 1719 | * @stable ICU 64 |
| 1720 | */ |
| 1721 | static MeasureUnit *createElectronvolt(UErrorCode &status); |
| 1722 | |
| 1723 | /** |
| 1724 | * Returns by value, unit of energy: electronvolt. |
| 1725 | * Also see {@link #createElectronvolt()}. |
| 1726 | * @stable ICU 64 |
| 1727 | */ |
| 1728 | static MeasureUnit getElectronvolt(); |
| 1729 | |
| 1730 | /** |
| 1731 | * Returns by pointer, unit of energy: foodcalorie. |
| 1732 | * Caller owns returned value and must free it. |
| 1733 | * Also see {@link #getFoodcalorie()}. |
| 1734 | * @param status ICU error code. |
| 1735 | * @stable ICU 54 |
| 1736 | */ |
| 1737 | static MeasureUnit *createFoodcalorie(UErrorCode &status); |
| 1738 | |
| 1739 | /** |
| 1740 | * Returns by value, unit of energy: foodcalorie. |
| 1741 | * Also see {@link #createFoodcalorie()}. |
| 1742 | * @stable ICU 64 |
| 1743 | */ |
| 1744 | static MeasureUnit getFoodcalorie(); |
| 1745 | |
| 1746 | /** |
| 1747 | * Returns by pointer, unit of energy: joule. |
| 1748 | * Caller owns returned value and must free it. |
| 1749 | * Also see {@link #getJoule()}. |
| 1750 | * @param status ICU error code. |
| 1751 | * @stable ICU 54 |
| 1752 | */ |
| 1753 | static MeasureUnit *createJoule(UErrorCode &status); |
| 1754 | |
| 1755 | /** |
| 1756 | * Returns by value, unit of energy: joule. |
| 1757 | * Also see {@link #createJoule()}. |
| 1758 | * @stable ICU 64 |
| 1759 | */ |
| 1760 | static MeasureUnit getJoule(); |
| 1761 | |
| 1762 | /** |
| 1763 | * Returns by pointer, unit of energy: kilocalorie. |
| 1764 | * Caller owns returned value and must free it. |
| 1765 | * Also see {@link #getKilocalorie()}. |
| 1766 | * @param status ICU error code. |
| 1767 | * @stable ICU 54 |
| 1768 | */ |
| 1769 | static MeasureUnit *createKilocalorie(UErrorCode &status); |
| 1770 | |
| 1771 | /** |
| 1772 | * Returns by value, unit of energy: kilocalorie. |
| 1773 | * Also see {@link #createKilocalorie()}. |
| 1774 | * @stable ICU 64 |
| 1775 | */ |
| 1776 | static MeasureUnit getKilocalorie(); |
| 1777 | |
| 1778 | /** |
| 1779 | * Returns by pointer, unit of energy: kilojoule. |
| 1780 | * Caller owns returned value and must free it. |
| 1781 | * Also see {@link #getKilojoule()}. |
| 1782 | * @param status ICU error code. |
| 1783 | * @stable ICU 54 |
| 1784 | */ |
| 1785 | static MeasureUnit *createKilojoule(UErrorCode &status); |
| 1786 | |
| 1787 | /** |
| 1788 | * Returns by value, unit of energy: kilojoule. |
| 1789 | * Also see {@link #createKilojoule()}. |
| 1790 | * @stable ICU 64 |
| 1791 | */ |
| 1792 | static MeasureUnit getKilojoule(); |
| 1793 | |
| 1794 | /** |
| 1795 | * Returns by pointer, unit of energy: kilowatt-hour. |
| 1796 | * Caller owns returned value and must free it. |
| 1797 | * Also see {@link #getKilowattHour()}. |
| 1798 | * @param status ICU error code. |
| 1799 | * @stable ICU 54 |
| 1800 | */ |
| 1801 | static MeasureUnit *createKilowattHour(UErrorCode &status); |
| 1802 | |
| 1803 | /** |
| 1804 | * Returns by value, unit of energy: kilowatt-hour. |
| 1805 | * Also see {@link #createKilowattHour()}. |
| 1806 | * @stable ICU 64 |
| 1807 | */ |
| 1808 | static MeasureUnit getKilowattHour(); |
| 1809 | |
| 1810 | /** |
| 1811 | * Returns by pointer, unit of energy: therm-us. |
| 1812 | * Caller owns returned value and must free it. |
| 1813 | * Also see {@link #getThermUs()}. |
| 1814 | * @param status ICU error code. |
| 1815 | * @stable ICU 65 |
| 1816 | */ |
| 1817 | static MeasureUnit *createThermUs(UErrorCode &status); |
| 1818 | |
| 1819 | /** |
| 1820 | * Returns by value, unit of energy: therm-us. |
| 1821 | * Also see {@link #createThermUs()}. |
| 1822 | * @stable ICU 65 |
| 1823 | */ |
| 1824 | static MeasureUnit getThermUs(); |
| 1825 | |
| 1826 | #ifndef U_HIDE_DRAFT_API |
| 1827 | /** |
| 1828 | * Returns by pointer, unit of force: kilowatt-hour-per-100-kilometer. |
| 1829 | * Caller owns returned value and must free it. |
| 1830 | * Also see {@link #getKilowattHourPer100Kilometer()}. |
| 1831 | * @param status ICU error code. |
| 1832 | * @draft ICU 70 |
| 1833 | */ |
| 1834 | static MeasureUnit *createKilowattHourPer100Kilometer(UErrorCode &status); |
| 1835 | |
| 1836 | /** |
| 1837 | * Returns by value, unit of force: kilowatt-hour-per-100-kilometer. |
| 1838 | * Also see {@link #createKilowattHourPer100Kilometer()}. |
| 1839 | * @draft ICU 70 |
| 1840 | */ |
| 1841 | static MeasureUnit getKilowattHourPer100Kilometer(); |
| 1842 | #endif /* U_HIDE_DRAFT_API */ |
| 1843 | |
| 1844 | /** |
| 1845 | * Returns by pointer, unit of force: newton. |
| 1846 | * Caller owns returned value and must free it. |
| 1847 | * Also see {@link #getNewton()}. |
| 1848 | * @param status ICU error code. |
| 1849 | * @stable ICU 64 |
| 1850 | */ |
| 1851 | static MeasureUnit *createNewton(UErrorCode &status); |
| 1852 | |
| 1853 | /** |
| 1854 | * Returns by value, unit of force: newton. |
| 1855 | * Also see {@link #createNewton()}. |
| 1856 | * @stable ICU 64 |
| 1857 | */ |
| 1858 | static MeasureUnit getNewton(); |
| 1859 | |
| 1860 | /** |
| 1861 | * Returns by pointer, unit of force: pound-force. |
| 1862 | * Caller owns returned value and must free it. |
| 1863 | * Also see {@link #getPoundForce()}. |
| 1864 | * @param status ICU error code. |
| 1865 | * @stable ICU 64 |
| 1866 | */ |
| 1867 | static MeasureUnit *createPoundForce(UErrorCode &status); |
| 1868 | |
| 1869 | /** |
| 1870 | * Returns by value, unit of force: pound-force. |
| 1871 | * Also see {@link #createPoundForce()}. |
| 1872 | * @stable ICU 64 |
| 1873 | */ |
| 1874 | static MeasureUnit getPoundForce(); |
| 1875 | |
| 1876 | /** |
| 1877 | * Returns by pointer, unit of frequency: gigahertz. |
| 1878 | * Caller owns returned value and must free it. |
| 1879 | * Also see {@link #getGigahertz()}. |
| 1880 | * @param status ICU error code. |
| 1881 | * @stable ICU 54 |
| 1882 | */ |
| 1883 | static MeasureUnit *createGigahertz(UErrorCode &status); |
| 1884 | |
| 1885 | /** |
| 1886 | * Returns by value, unit of frequency: gigahertz. |
| 1887 | * Also see {@link #createGigahertz()}. |
| 1888 | * @stable ICU 64 |
| 1889 | */ |
| 1890 | static MeasureUnit getGigahertz(); |
| 1891 | |
| 1892 | /** |
| 1893 | * Returns by pointer, unit of frequency: hertz. |
| 1894 | * Caller owns returned value and must free it. |
| 1895 | * Also see {@link #getHertz()}. |
| 1896 | * @param status ICU error code. |
| 1897 | * @stable ICU 54 |
| 1898 | */ |
| 1899 | static MeasureUnit *createHertz(UErrorCode &status); |
| 1900 | |
| 1901 | /** |
| 1902 | * Returns by value, unit of frequency: hertz. |
| 1903 | * Also see {@link #createHertz()}. |
| 1904 | * @stable ICU 64 |
| 1905 | */ |
| 1906 | static MeasureUnit getHertz(); |
| 1907 | |
| 1908 | /** |
| 1909 | * Returns by pointer, unit of frequency: kilohertz. |
| 1910 | * Caller owns returned value and must free it. |
| 1911 | * Also see {@link #getKilohertz()}. |
| 1912 | * @param status ICU error code. |
| 1913 | * @stable ICU 54 |
| 1914 | */ |
| 1915 | static MeasureUnit *createKilohertz(UErrorCode &status); |
| 1916 | |
| 1917 | /** |
| 1918 | * Returns by value, unit of frequency: kilohertz. |
| 1919 | * Also see {@link #createKilohertz()}. |
| 1920 | * @stable ICU 64 |
| 1921 | */ |
| 1922 | static MeasureUnit getKilohertz(); |
| 1923 | |
| 1924 | /** |
| 1925 | * Returns by pointer, unit of frequency: megahertz. |
| 1926 | * Caller owns returned value and must free it. |
| 1927 | * Also see {@link #getMegahertz()}. |
| 1928 | * @param status ICU error code. |
| 1929 | * @stable ICU 54 |
| 1930 | */ |
| 1931 | static MeasureUnit *createMegahertz(UErrorCode &status); |
| 1932 | |
| 1933 | /** |
| 1934 | * Returns by value, unit of frequency: megahertz. |
| 1935 | * Also see {@link #createMegahertz()}. |
| 1936 | * @stable ICU 64 |
| 1937 | */ |
| 1938 | static MeasureUnit getMegahertz(); |
| 1939 | |
| 1940 | /** |
| 1941 | * Returns by pointer, unit of graphics: dot. |
| 1942 | * Caller owns returned value and must free it. |
| 1943 | * Also see {@link #getDot()}. |
| 1944 | * @param status ICU error code. |
| 1945 | * @stable ICU 68 |
| 1946 | */ |
| 1947 | static MeasureUnit *createDot(UErrorCode &status); |
| 1948 | |
| 1949 | /** |
| 1950 | * Returns by value, unit of graphics: dot. |
| 1951 | * Also see {@link #createDot()}. |
| 1952 | * @stable ICU 68 |
| 1953 | */ |
| 1954 | static MeasureUnit getDot(); |
| 1955 | |
| 1956 | /** |
| 1957 | * Returns by pointer, unit of graphics: dot-per-centimeter. |
| 1958 | * Caller owns returned value and must free it. |
| 1959 | * Also see {@link #getDotPerCentimeter()}. |
| 1960 | * @param status ICU error code. |
| 1961 | * @stable ICU 65 |
| 1962 | */ |
| 1963 | static MeasureUnit *createDotPerCentimeter(UErrorCode &status); |
| 1964 | |
| 1965 | /** |
| 1966 | * Returns by value, unit of graphics: dot-per-centimeter. |
| 1967 | * Also see {@link #createDotPerCentimeter()}. |
| 1968 | * @stable ICU 65 |
| 1969 | */ |
| 1970 | static MeasureUnit getDotPerCentimeter(); |
| 1971 | |
| 1972 | /** |
| 1973 | * Returns by pointer, unit of graphics: dot-per-inch. |
| 1974 | * Caller owns returned value and must free it. |
| 1975 | * Also see {@link #getDotPerInch()}. |
| 1976 | * @param status ICU error code. |
| 1977 | * @stable ICU 65 |
| 1978 | */ |
| 1979 | static MeasureUnit *createDotPerInch(UErrorCode &status); |
| 1980 | |
| 1981 | /** |
| 1982 | * Returns by value, unit of graphics: dot-per-inch. |
| 1983 | * Also see {@link #createDotPerInch()}. |
| 1984 | * @stable ICU 65 |
| 1985 | */ |
| 1986 | static MeasureUnit getDotPerInch(); |
| 1987 | |
| 1988 | /** |
| 1989 | * Returns by pointer, unit of graphics: em. |
| 1990 | * Caller owns returned value and must free it. |
| 1991 | * Also see {@link #getEm()}. |
| 1992 | * @param status ICU error code. |
| 1993 | * @stable ICU 65 |
| 1994 | */ |
| 1995 | static MeasureUnit *createEm(UErrorCode &status); |
| 1996 | |
| 1997 | /** |
| 1998 | * Returns by value, unit of graphics: em. |
| 1999 | * Also see {@link #createEm()}. |
| 2000 | * @stable ICU 65 |
| 2001 | */ |
| 2002 | static MeasureUnit getEm(); |
| 2003 | |
| 2004 | /** |
| 2005 | * Returns by pointer, unit of graphics: megapixel. |
| 2006 | * Caller owns returned value and must free it. |
| 2007 | * Also see {@link #getMegapixel()}. |
| 2008 | * @param status ICU error code. |
| 2009 | * @stable ICU 65 |
| 2010 | */ |
| 2011 | static MeasureUnit *createMegapixel(UErrorCode &status); |
| 2012 | |
| 2013 | /** |
| 2014 | * Returns by value, unit of graphics: megapixel. |
| 2015 | * Also see {@link #createMegapixel()}. |
| 2016 | * @stable ICU 65 |
| 2017 | */ |
| 2018 | static MeasureUnit getMegapixel(); |
| 2019 | |
| 2020 | /** |
| 2021 | * Returns by pointer, unit of graphics: pixel. |
| 2022 | * Caller owns returned value and must free it. |
| 2023 | * Also see {@link #getPixel()}. |
| 2024 | * @param status ICU error code. |
| 2025 | * @stable ICU 65 |
| 2026 | */ |
| 2027 | static MeasureUnit *createPixel(UErrorCode &status); |
| 2028 | |
| 2029 | /** |
| 2030 | * Returns by value, unit of graphics: pixel. |
| 2031 | * Also see {@link #createPixel()}. |
| 2032 | * @stable ICU 65 |
| 2033 | */ |
| 2034 | static MeasureUnit getPixel(); |
| 2035 | |
| 2036 | /** |
| 2037 | * Returns by pointer, unit of graphics: pixel-per-centimeter. |
| 2038 | * Caller owns returned value and must free it. |
| 2039 | * Also see {@link #getPixelPerCentimeter()}. |
| 2040 | * @param status ICU error code. |
| 2041 | * @stable ICU 65 |
| 2042 | */ |
| 2043 | static MeasureUnit *createPixelPerCentimeter(UErrorCode &status); |
| 2044 | |
| 2045 | /** |
| 2046 | * Returns by value, unit of graphics: pixel-per-centimeter. |
| 2047 | * Also see {@link #createPixelPerCentimeter()}. |
| 2048 | * @stable ICU 65 |
| 2049 | */ |
| 2050 | static MeasureUnit getPixelPerCentimeter(); |
| 2051 | |
| 2052 | /** |
| 2053 | * Returns by pointer, unit of graphics: pixel-per-inch. |
| 2054 | * Caller owns returned value and must free it. |
| 2055 | * Also see {@link #getPixelPerInch()}. |
| 2056 | * @param status ICU error code. |
| 2057 | * @stable ICU 65 |
| 2058 | */ |
| 2059 | static MeasureUnit *createPixelPerInch(UErrorCode &status); |
| 2060 | |
| 2061 | /** |
| 2062 | * Returns by value, unit of graphics: pixel-per-inch. |
| 2063 | * Also see {@link #createPixelPerInch()}. |
| 2064 | * @stable ICU 65 |
| 2065 | */ |
| 2066 | static MeasureUnit getPixelPerInch(); |
| 2067 | |
| 2068 | /** |
| 2069 | * Returns by pointer, unit of length: astronomical-unit. |
| 2070 | * Caller owns returned value and must free it. |
| 2071 | * Also see {@link #getAstronomicalUnit()}. |
| 2072 | * @param status ICU error code. |
| 2073 | * @stable ICU 54 |
| 2074 | */ |
| 2075 | static MeasureUnit *createAstronomicalUnit(UErrorCode &status); |
| 2076 | |
| 2077 | /** |
| 2078 | * Returns by value, unit of length: astronomical-unit. |
| 2079 | * Also see {@link #createAstronomicalUnit()}. |
| 2080 | * @stable ICU 64 |
| 2081 | */ |
| 2082 | static MeasureUnit getAstronomicalUnit(); |
| 2083 | |
| 2084 | /** |
| 2085 | * Returns by pointer, unit of length: centimeter. |
| 2086 | * Caller owns returned value and must free it. |
| 2087 | * Also see {@link #getCentimeter()}. |
| 2088 | * @param status ICU error code. |
| 2089 | * @stable ICU 53 |
| 2090 | */ |
| 2091 | static MeasureUnit *createCentimeter(UErrorCode &status); |
| 2092 | |
| 2093 | /** |
| 2094 | * Returns by value, unit of length: centimeter. |
| 2095 | * Also see {@link #createCentimeter()}. |
| 2096 | * @stable ICU 64 |
| 2097 | */ |
| 2098 | static MeasureUnit getCentimeter(); |
| 2099 | |
| 2100 | /** |
| 2101 | * Returns by pointer, unit of length: decimeter. |
| 2102 | * Caller owns returned value and must free it. |
| 2103 | * Also see {@link #getDecimeter()}. |
| 2104 | * @param status ICU error code. |
| 2105 | * @stable ICU 54 |
| 2106 | */ |
| 2107 | static MeasureUnit *createDecimeter(UErrorCode &status); |
| 2108 | |
| 2109 | /** |
| 2110 | * Returns by value, unit of length: decimeter. |
| 2111 | * Also see {@link #createDecimeter()}. |
| 2112 | * @stable ICU 64 |
| 2113 | */ |
| 2114 | static MeasureUnit getDecimeter(); |
| 2115 | |
| 2116 | /** |
| 2117 | * Returns by pointer, unit of length: earth-radius. |
| 2118 | * Caller owns returned value and must free it. |
| 2119 | * Also see {@link #getEarthRadius()}. |
| 2120 | * @param status ICU error code. |
| 2121 | * @stable ICU 68 |
| 2122 | */ |
| 2123 | static MeasureUnit *createEarthRadius(UErrorCode &status); |
| 2124 | |
| 2125 | /** |
| 2126 | * Returns by value, unit of length: earth-radius. |
| 2127 | * Also see {@link #createEarthRadius()}. |
| 2128 | * @stable ICU 68 |
| 2129 | */ |
| 2130 | static MeasureUnit getEarthRadius(); |
| 2131 | |
| 2132 | /** |
| 2133 | * Returns by pointer, unit of length: fathom. |
| 2134 | * Caller owns returned value and must free it. |
| 2135 | * Also see {@link #getFathom()}. |
| 2136 | * @param status ICU error code. |
| 2137 | * @stable ICU 54 |
| 2138 | */ |
| 2139 | static MeasureUnit *createFathom(UErrorCode &status); |
| 2140 | |
| 2141 | /** |
| 2142 | * Returns by value, unit of length: fathom. |
| 2143 | * Also see {@link #createFathom()}. |
| 2144 | * @stable ICU 64 |
| 2145 | */ |
| 2146 | static MeasureUnit getFathom(); |
| 2147 | |
| 2148 | /** |
| 2149 | * Returns by pointer, unit of length: foot. |
| 2150 | * Caller owns returned value and must free it. |
| 2151 | * Also see {@link #getFoot()}. |
| 2152 | * @param status ICU error code. |
| 2153 | * @stable ICU 53 |
| 2154 | */ |
| 2155 | static MeasureUnit *(UErrorCode &status); |
| 2156 | |
| 2157 | /** |
| 2158 | * Returns by value, unit of length: foot. |
| 2159 | * Also see {@link #createFoot()}. |
| 2160 | * @stable ICU 64 |
| 2161 | */ |
| 2162 | static MeasureUnit (); |
| 2163 | |
| 2164 | /** |
| 2165 | * Returns by pointer, unit of length: furlong. |
| 2166 | * Caller owns returned value and must free it. |
| 2167 | * Also see {@link #getFurlong()}. |
| 2168 | * @param status ICU error code. |
| 2169 | * @stable ICU 54 |
| 2170 | */ |
| 2171 | static MeasureUnit *createFurlong(UErrorCode &status); |
| 2172 | |
| 2173 | /** |
| 2174 | * Returns by value, unit of length: furlong. |
| 2175 | * Also see {@link #createFurlong()}. |
| 2176 | * @stable ICU 64 |
| 2177 | */ |
| 2178 | static MeasureUnit getFurlong(); |
| 2179 | |
| 2180 | /** |
| 2181 | * Returns by pointer, unit of length: inch. |
| 2182 | * Caller owns returned value and must free it. |
| 2183 | * Also see {@link #getInch()}. |
| 2184 | * @param status ICU error code. |
| 2185 | * @stable ICU 53 |
| 2186 | */ |
| 2187 | static MeasureUnit *createInch(UErrorCode &status); |
| 2188 | |
| 2189 | /** |
| 2190 | * Returns by value, unit of length: inch. |
| 2191 | * Also see {@link #createInch()}. |
| 2192 | * @stable ICU 64 |
| 2193 | */ |
| 2194 | static MeasureUnit getInch(); |
| 2195 | |
| 2196 | /** |
| 2197 | * Returns by pointer, unit of length: kilometer. |
| 2198 | * Caller owns returned value and must free it. |
| 2199 | * Also see {@link #getKilometer()}. |
| 2200 | * @param status ICU error code. |
| 2201 | * @stable ICU 53 |
| 2202 | */ |
| 2203 | static MeasureUnit *createKilometer(UErrorCode &status); |
| 2204 | |
| 2205 | /** |
| 2206 | * Returns by value, unit of length: kilometer. |
| 2207 | * Also see {@link #createKilometer()}. |
| 2208 | * @stable ICU 64 |
| 2209 | */ |
| 2210 | static MeasureUnit getKilometer(); |
| 2211 | |
| 2212 | /** |
| 2213 | * Returns by pointer, unit of length: light-year. |
| 2214 | * Caller owns returned value and must free it. |
| 2215 | * Also see {@link #getLightYear()}. |
| 2216 | * @param status ICU error code. |
| 2217 | * @stable ICU 53 |
| 2218 | */ |
| 2219 | static MeasureUnit *createLightYear(UErrorCode &status); |
| 2220 | |
| 2221 | /** |
| 2222 | * Returns by value, unit of length: light-year. |
| 2223 | * Also see {@link #createLightYear()}. |
| 2224 | * @stable ICU 64 |
| 2225 | */ |
| 2226 | static MeasureUnit getLightYear(); |
| 2227 | |
| 2228 | /** |
| 2229 | * Returns by pointer, unit of length: meter. |
| 2230 | * Caller owns returned value and must free it. |
| 2231 | * Also see {@link #getMeter()}. |
| 2232 | * @param status ICU error code. |
| 2233 | * @stable ICU 53 |
| 2234 | */ |
| 2235 | static MeasureUnit *createMeter(UErrorCode &status); |
| 2236 | |
| 2237 | /** |
| 2238 | * Returns by value, unit of length: meter. |
| 2239 | * Also see {@link #createMeter()}. |
| 2240 | * @stable ICU 64 |
| 2241 | */ |
| 2242 | static MeasureUnit getMeter(); |
| 2243 | |
| 2244 | /** |
| 2245 | * Returns by pointer, unit of length: micrometer. |
| 2246 | * Caller owns returned value and must free it. |
| 2247 | * Also see {@link #getMicrometer()}. |
| 2248 | * @param status ICU error code. |
| 2249 | * @stable ICU 54 |
| 2250 | */ |
| 2251 | static MeasureUnit *createMicrometer(UErrorCode &status); |
| 2252 | |
| 2253 | /** |
| 2254 | * Returns by value, unit of length: micrometer. |
| 2255 | * Also see {@link #createMicrometer()}. |
| 2256 | * @stable ICU 64 |
| 2257 | */ |
| 2258 | static MeasureUnit getMicrometer(); |
| 2259 | |
| 2260 | /** |
| 2261 | * Returns by pointer, unit of length: mile. |
| 2262 | * Caller owns returned value and must free it. |
| 2263 | * Also see {@link #getMile()}. |
| 2264 | * @param status ICU error code. |
| 2265 | * @stable ICU 53 |
| 2266 | */ |
| 2267 | static MeasureUnit *createMile(UErrorCode &status); |
| 2268 | |
| 2269 | /** |
| 2270 | * Returns by value, unit of length: mile. |
| 2271 | * Also see {@link #createMile()}. |
| 2272 | * @stable ICU 64 |
| 2273 | */ |
| 2274 | static MeasureUnit getMile(); |
| 2275 | |
| 2276 | /** |
| 2277 | * Returns by pointer, unit of length: mile-scandinavian. |
| 2278 | * Caller owns returned value and must free it. |
| 2279 | * Also see {@link #getMileScandinavian()}. |
| 2280 | * @param status ICU error code. |
| 2281 | * @stable ICU 56 |
| 2282 | */ |
| 2283 | static MeasureUnit *createMileScandinavian(UErrorCode &status); |
| 2284 | |
| 2285 | /** |
| 2286 | * Returns by value, unit of length: mile-scandinavian. |
| 2287 | * Also see {@link #createMileScandinavian()}. |
| 2288 | * @stable ICU 64 |
| 2289 | */ |
| 2290 | static MeasureUnit getMileScandinavian(); |
| 2291 | |
| 2292 | /** |
| 2293 | * Returns by pointer, unit of length: millimeter. |
| 2294 | * Caller owns returned value and must free it. |
| 2295 | * Also see {@link #getMillimeter()}. |
| 2296 | * @param status ICU error code. |
| 2297 | * @stable ICU 53 |
| 2298 | */ |
| 2299 | static MeasureUnit *createMillimeter(UErrorCode &status); |
| 2300 | |
| 2301 | /** |
| 2302 | * Returns by value, unit of length: millimeter. |
| 2303 | * Also see {@link #createMillimeter()}. |
| 2304 | * @stable ICU 64 |
| 2305 | */ |
| 2306 | static MeasureUnit getMillimeter(); |
| 2307 | |
| 2308 | /** |
| 2309 | * Returns by pointer, unit of length: nanometer. |
| 2310 | * Caller owns returned value and must free it. |
| 2311 | * Also see {@link #getNanometer()}. |
| 2312 | * @param status ICU error code. |
| 2313 | * @stable ICU 54 |
| 2314 | */ |
| 2315 | static MeasureUnit *createNanometer(UErrorCode &status); |
| 2316 | |
| 2317 | /** |
| 2318 | * Returns by value, unit of length: nanometer. |
| 2319 | * Also see {@link #createNanometer()}. |
| 2320 | * @stable ICU 64 |
| 2321 | */ |
| 2322 | static MeasureUnit getNanometer(); |
| 2323 | |
| 2324 | /** |
| 2325 | * Returns by pointer, unit of length: nautical-mile. |
| 2326 | * Caller owns returned value and must free it. |
| 2327 | * Also see {@link #getNauticalMile()}. |
| 2328 | * @param status ICU error code. |
| 2329 | * @stable ICU 54 |
| 2330 | */ |
| 2331 | static MeasureUnit *createNauticalMile(UErrorCode &status); |
| 2332 | |
| 2333 | /** |
| 2334 | * Returns by value, unit of length: nautical-mile. |
| 2335 | * Also see {@link #createNauticalMile()}. |
| 2336 | * @stable ICU 64 |
| 2337 | */ |
| 2338 | static MeasureUnit getNauticalMile(); |
| 2339 | |
| 2340 | /** |
| 2341 | * Returns by pointer, unit of length: parsec. |
| 2342 | * Caller owns returned value and must free it. |
| 2343 | * Also see {@link #getParsec()}. |
| 2344 | * @param status ICU error code. |
| 2345 | * @stable ICU 54 |
| 2346 | */ |
| 2347 | static MeasureUnit *createParsec(UErrorCode &status); |
| 2348 | |
| 2349 | /** |
| 2350 | * Returns by value, unit of length: parsec. |
| 2351 | * Also see {@link #createParsec()}. |
| 2352 | * @stable ICU 64 |
| 2353 | */ |
| 2354 | static MeasureUnit getParsec(); |
| 2355 | |
| 2356 | /** |
| 2357 | * Returns by pointer, unit of length: picometer. |
| 2358 | * Caller owns returned value and must free it. |
| 2359 | * Also see {@link #getPicometer()}. |
| 2360 | * @param status ICU error code. |
| 2361 | * @stable ICU 53 |
| 2362 | */ |
| 2363 | static MeasureUnit *createPicometer(UErrorCode &status); |
| 2364 | |
| 2365 | /** |
| 2366 | * Returns by value, unit of length: picometer. |
| 2367 | * Also see {@link #createPicometer()}. |
| 2368 | * @stable ICU 64 |
| 2369 | */ |
| 2370 | static MeasureUnit getPicometer(); |
| 2371 | |
| 2372 | /** |
| 2373 | * Returns by pointer, unit of length: point. |
| 2374 | * Caller owns returned value and must free it. |
| 2375 | * Also see {@link #getPoint()}. |
| 2376 | * @param status ICU error code. |
| 2377 | * @stable ICU 59 |
| 2378 | */ |
| 2379 | static MeasureUnit *createPoint(UErrorCode &status); |
| 2380 | |
| 2381 | /** |
| 2382 | * Returns by value, unit of length: point. |
| 2383 | * Also see {@link #createPoint()}. |
| 2384 | * @stable ICU 64 |
| 2385 | */ |
| 2386 | static MeasureUnit getPoint(); |
| 2387 | |
| 2388 | /** |
| 2389 | * Returns by pointer, unit of length: solar-radius. |
| 2390 | * Caller owns returned value and must free it. |
| 2391 | * Also see {@link #getSolarRadius()}. |
| 2392 | * @param status ICU error code. |
| 2393 | * @stable ICU 64 |
| 2394 | */ |
| 2395 | static MeasureUnit *createSolarRadius(UErrorCode &status); |
| 2396 | |
| 2397 | /** |
| 2398 | * Returns by value, unit of length: solar-radius. |
| 2399 | * Also see {@link #createSolarRadius()}. |
| 2400 | * @stable ICU 64 |
| 2401 | */ |
| 2402 | static MeasureUnit getSolarRadius(); |
| 2403 | |
| 2404 | /** |
| 2405 | * Returns by pointer, unit of length: yard. |
| 2406 | * Caller owns returned value and must free it. |
| 2407 | * Also see {@link #getYard()}. |
| 2408 | * @param status ICU error code. |
| 2409 | * @stable ICU 53 |
| 2410 | */ |
| 2411 | static MeasureUnit *createYard(UErrorCode &status); |
| 2412 | |
| 2413 | /** |
| 2414 | * Returns by value, unit of length: yard. |
| 2415 | * Also see {@link #createYard()}. |
| 2416 | * @stable ICU 64 |
| 2417 | */ |
| 2418 | static MeasureUnit getYard(); |
| 2419 | |
| 2420 | /** |
| 2421 | * Returns by pointer, unit of light: candela. |
| 2422 | * Caller owns returned value and must free it. |
| 2423 | * Also see {@link #getCandela()}. |
| 2424 | * @param status ICU error code. |
| 2425 | * @stable ICU 68 |
| 2426 | */ |
| 2427 | static MeasureUnit *createCandela(UErrorCode &status); |
| 2428 | |
| 2429 | /** |
| 2430 | * Returns by value, unit of light: candela. |
| 2431 | * Also see {@link #createCandela()}. |
| 2432 | * @stable ICU 68 |
| 2433 | */ |
| 2434 | static MeasureUnit getCandela(); |
| 2435 | |
| 2436 | /** |
| 2437 | * Returns by pointer, unit of light: lumen. |
| 2438 | * Caller owns returned value and must free it. |
| 2439 | * Also see {@link #getLumen()}. |
| 2440 | * @param status ICU error code. |
| 2441 | * @stable ICU 68 |
| 2442 | */ |
| 2443 | static MeasureUnit *createLumen(UErrorCode &status); |
| 2444 | |
| 2445 | /** |
| 2446 | * Returns by value, unit of light: lumen. |
| 2447 | * Also see {@link #createLumen()}. |
| 2448 | * @stable ICU 68 |
| 2449 | */ |
| 2450 | static MeasureUnit getLumen(); |
| 2451 | |
| 2452 | /** |
| 2453 | * Returns by pointer, unit of light: lux. |
| 2454 | * Caller owns returned value and must free it. |
| 2455 | * Also see {@link #getLux()}. |
| 2456 | * @param status ICU error code. |
| 2457 | * @stable ICU 54 |
| 2458 | */ |
| 2459 | static MeasureUnit *createLux(UErrorCode &status); |
| 2460 | |
| 2461 | /** |
| 2462 | * Returns by value, unit of light: lux. |
| 2463 | * Also see {@link #createLux()}. |
| 2464 | * @stable ICU 64 |
| 2465 | */ |
| 2466 | static MeasureUnit getLux(); |
| 2467 | |
| 2468 | /** |
| 2469 | * Returns by pointer, unit of light: solar-luminosity. |
| 2470 | * Caller owns returned value and must free it. |
| 2471 | * Also see {@link #getSolarLuminosity()}. |
| 2472 | * @param status ICU error code. |
| 2473 | * @stable ICU 64 |
| 2474 | */ |
| 2475 | static MeasureUnit *createSolarLuminosity(UErrorCode &status); |
| 2476 | |
| 2477 | /** |
| 2478 | * Returns by value, unit of light: solar-luminosity. |
| 2479 | * Also see {@link #createSolarLuminosity()}. |
| 2480 | * @stable ICU 64 |
| 2481 | */ |
| 2482 | static MeasureUnit getSolarLuminosity(); |
| 2483 | |
| 2484 | /** |
| 2485 | * Returns by pointer, unit of mass: carat. |
| 2486 | * Caller owns returned value and must free it. |
| 2487 | * Also see {@link #getCarat()}. |
| 2488 | * @param status ICU error code. |
| 2489 | * @stable ICU 54 |
| 2490 | */ |
| 2491 | static MeasureUnit *createCarat(UErrorCode &status); |
| 2492 | |
| 2493 | /** |
| 2494 | * Returns by value, unit of mass: carat. |
| 2495 | * Also see {@link #createCarat()}. |
| 2496 | * @stable ICU 64 |
| 2497 | */ |
| 2498 | static MeasureUnit getCarat(); |
| 2499 | |
| 2500 | /** |
| 2501 | * Returns by pointer, unit of mass: dalton. |
| 2502 | * Caller owns returned value and must free it. |
| 2503 | * Also see {@link #getDalton()}. |
| 2504 | * @param status ICU error code. |
| 2505 | * @stable ICU 64 |
| 2506 | */ |
| 2507 | static MeasureUnit *createDalton(UErrorCode &status); |
| 2508 | |
| 2509 | /** |
| 2510 | * Returns by value, unit of mass: dalton. |
| 2511 | * Also see {@link #createDalton()}. |
| 2512 | * @stable ICU 64 |
| 2513 | */ |
| 2514 | static MeasureUnit getDalton(); |
| 2515 | |
| 2516 | /** |
| 2517 | * Returns by pointer, unit of mass: earth-mass. |
| 2518 | * Caller owns returned value and must free it. |
| 2519 | * Also see {@link #getEarthMass()}. |
| 2520 | * @param status ICU error code. |
| 2521 | * @stable ICU 64 |
| 2522 | */ |
| 2523 | static MeasureUnit *createEarthMass(UErrorCode &status); |
| 2524 | |
| 2525 | /** |
| 2526 | * Returns by value, unit of mass: earth-mass. |
| 2527 | * Also see {@link #createEarthMass()}. |
| 2528 | * @stable ICU 64 |
| 2529 | */ |
| 2530 | static MeasureUnit getEarthMass(); |
| 2531 | |
| 2532 | /** |
| 2533 | * Returns by pointer, unit of mass: grain. |
| 2534 | * Caller owns returned value and must free it. |
| 2535 | * Also see {@link #getGrain()}. |
| 2536 | * @param status ICU error code. |
| 2537 | * @stable ICU 68 |
| 2538 | */ |
| 2539 | static MeasureUnit *createGrain(UErrorCode &status); |
| 2540 | |
| 2541 | /** |
| 2542 | * Returns by value, unit of mass: grain. |
| 2543 | * Also see {@link #createGrain()}. |
| 2544 | * @stable ICU 68 |
| 2545 | */ |
| 2546 | static MeasureUnit getGrain(); |
| 2547 | |
| 2548 | /** |
| 2549 | * Returns by pointer, unit of mass: gram. |
| 2550 | * Caller owns returned value and must free it. |
| 2551 | * Also see {@link #getGram()}. |
| 2552 | * @param status ICU error code. |
| 2553 | * @stable ICU 53 |
| 2554 | */ |
| 2555 | static MeasureUnit *createGram(UErrorCode &status); |
| 2556 | |
| 2557 | /** |
| 2558 | * Returns by value, unit of mass: gram. |
| 2559 | * Also see {@link #createGram()}. |
| 2560 | * @stable ICU 64 |
| 2561 | */ |
| 2562 | static MeasureUnit getGram(); |
| 2563 | |
| 2564 | /** |
| 2565 | * Returns by pointer, unit of mass: kilogram. |
| 2566 | * Caller owns returned value and must free it. |
| 2567 | * Also see {@link #getKilogram()}. |
| 2568 | * @param status ICU error code. |
| 2569 | * @stable ICU 53 |
| 2570 | */ |
| 2571 | static MeasureUnit *createKilogram(UErrorCode &status); |
| 2572 | |
| 2573 | /** |
| 2574 | * Returns by value, unit of mass: kilogram. |
| 2575 | * Also see {@link #createKilogram()}. |
| 2576 | * @stable ICU 64 |
| 2577 | */ |
| 2578 | static MeasureUnit getKilogram(); |
| 2579 | |
| 2580 | /** |
| 2581 | * Returns by pointer, unit of mass: metric-ton. |
| 2582 | * Caller owns returned value and must free it. |
| 2583 | * Also see {@link #getMetricTon()}. |
| 2584 | * @param status ICU error code. |
| 2585 | * @stable ICU 54 |
| 2586 | */ |
| 2587 | static MeasureUnit *createMetricTon(UErrorCode &status); |
| 2588 | |
| 2589 | /** |
| 2590 | * Returns by value, unit of mass: metric-ton. |
| 2591 | * Also see {@link #createMetricTon()}. |
| 2592 | * @stable ICU 64 |
| 2593 | */ |
| 2594 | static MeasureUnit getMetricTon(); |
| 2595 | |
| 2596 | /** |
| 2597 | * Returns by pointer, unit of mass: microgram. |
| 2598 | * Caller owns returned value and must free it. |
| 2599 | * Also see {@link #getMicrogram()}. |
| 2600 | * @param status ICU error code. |
| 2601 | * @stable ICU 54 |
| 2602 | */ |
| 2603 | static MeasureUnit *createMicrogram(UErrorCode &status); |
| 2604 | |
| 2605 | /** |
| 2606 | * Returns by value, unit of mass: microgram. |
| 2607 | * Also see {@link #createMicrogram()}. |
| 2608 | * @stable ICU 64 |
| 2609 | */ |
| 2610 | static MeasureUnit getMicrogram(); |
| 2611 | |
| 2612 | /** |
| 2613 | * Returns by pointer, unit of mass: milligram. |
| 2614 | * Caller owns returned value and must free it. |
| 2615 | * Also see {@link #getMilligram()}. |
| 2616 | * @param status ICU error code. |
| 2617 | * @stable ICU 54 |
| 2618 | */ |
| 2619 | static MeasureUnit *createMilligram(UErrorCode &status); |
| 2620 | |
| 2621 | /** |
| 2622 | * Returns by value, unit of mass: milligram. |
| 2623 | * Also see {@link #createMilligram()}. |
| 2624 | * @stable ICU 64 |
| 2625 | */ |
| 2626 | static MeasureUnit getMilligram(); |
| 2627 | |
| 2628 | /** |
| 2629 | * Returns by pointer, unit of mass: ounce. |
| 2630 | * Caller owns returned value and must free it. |
| 2631 | * Also see {@link #getOunce()}. |
| 2632 | * @param status ICU error code. |
| 2633 | * @stable ICU 53 |
| 2634 | */ |
| 2635 | static MeasureUnit *createOunce(UErrorCode &status); |
| 2636 | |
| 2637 | /** |
| 2638 | * Returns by value, unit of mass: ounce. |
| 2639 | * Also see {@link #createOunce()}. |
| 2640 | * @stable ICU 64 |
| 2641 | */ |
| 2642 | static MeasureUnit getOunce(); |
| 2643 | |
| 2644 | /** |
| 2645 | * Returns by pointer, unit of mass: ounce-troy. |
| 2646 | * Caller owns returned value and must free it. |
| 2647 | * Also see {@link #getOunceTroy()}. |
| 2648 | * @param status ICU error code. |
| 2649 | * @stable ICU 54 |
| 2650 | */ |
| 2651 | static MeasureUnit *createOunceTroy(UErrorCode &status); |
| 2652 | |
| 2653 | /** |
| 2654 | * Returns by value, unit of mass: ounce-troy. |
| 2655 | * Also see {@link #createOunceTroy()}. |
| 2656 | * @stable ICU 64 |
| 2657 | */ |
| 2658 | static MeasureUnit getOunceTroy(); |
| 2659 | |
| 2660 | /** |
| 2661 | * Returns by pointer, unit of mass: pound. |
| 2662 | * Caller owns returned value and must free it. |
| 2663 | * Also see {@link #getPound()}. |
| 2664 | * @param status ICU error code. |
| 2665 | * @stable ICU 53 |
| 2666 | */ |
| 2667 | static MeasureUnit *createPound(UErrorCode &status); |
| 2668 | |
| 2669 | /** |
| 2670 | * Returns by value, unit of mass: pound. |
| 2671 | * Also see {@link #createPound()}. |
| 2672 | * @stable ICU 64 |
| 2673 | */ |
| 2674 | static MeasureUnit getPound(); |
| 2675 | |
| 2676 | /** |
| 2677 | * Returns by pointer, unit of mass: solar-mass. |
| 2678 | * Caller owns returned value and must free it. |
| 2679 | * Also see {@link #getSolarMass()}. |
| 2680 | * @param status ICU error code. |
| 2681 | * @stable ICU 64 |
| 2682 | */ |
| 2683 | static MeasureUnit *createSolarMass(UErrorCode &status); |
| 2684 | |
| 2685 | /** |
| 2686 | * Returns by value, unit of mass: solar-mass. |
| 2687 | * Also see {@link #createSolarMass()}. |
| 2688 | * @stable ICU 64 |
| 2689 | */ |
| 2690 | static MeasureUnit getSolarMass(); |
| 2691 | |
| 2692 | /** |
| 2693 | * Returns by pointer, unit of mass: stone. |
| 2694 | * Caller owns returned value and must free it. |
| 2695 | * Also see {@link #getStone()}. |
| 2696 | * @param status ICU error code. |
| 2697 | * @stable ICU 54 |
| 2698 | */ |
| 2699 | static MeasureUnit *createStone(UErrorCode &status); |
| 2700 | |
| 2701 | /** |
| 2702 | * Returns by value, unit of mass: stone. |
| 2703 | * Also see {@link #createStone()}. |
| 2704 | * @stable ICU 64 |
| 2705 | */ |
| 2706 | static MeasureUnit getStone(); |
| 2707 | |
| 2708 | /** |
| 2709 | * Returns by pointer, unit of mass: ton. |
| 2710 | * Caller owns returned value and must free it. |
| 2711 | * Also see {@link #getTon()}. |
| 2712 | * @param status ICU error code. |
| 2713 | * @stable ICU 54 |
| 2714 | */ |
| 2715 | static MeasureUnit *createTon(UErrorCode &status); |
| 2716 | |
| 2717 | /** |
| 2718 | * Returns by value, unit of mass: ton. |
| 2719 | * Also see {@link #createTon()}. |
| 2720 | * @stable ICU 64 |
| 2721 | */ |
| 2722 | static MeasureUnit getTon(); |
| 2723 | |
| 2724 | /** |
| 2725 | * Returns by pointer, unit of power: gigawatt. |
| 2726 | * Caller owns returned value and must free it. |
| 2727 | * Also see {@link #getGigawatt()}. |
| 2728 | * @param status ICU error code. |
| 2729 | * @stable ICU 54 |
| 2730 | */ |
| 2731 | static MeasureUnit *createGigawatt(UErrorCode &status); |
| 2732 | |
| 2733 | /** |
| 2734 | * Returns by value, unit of power: gigawatt. |
| 2735 | * Also see {@link #createGigawatt()}. |
| 2736 | * @stable ICU 64 |
| 2737 | */ |
| 2738 | static MeasureUnit getGigawatt(); |
| 2739 | |
| 2740 | /** |
| 2741 | * Returns by pointer, unit of power: horsepower. |
| 2742 | * Caller owns returned value and must free it. |
| 2743 | * Also see {@link #getHorsepower()}. |
| 2744 | * @param status ICU error code. |
| 2745 | * @stable ICU 53 |
| 2746 | */ |
| 2747 | static MeasureUnit *createHorsepower(UErrorCode &status); |
| 2748 | |
| 2749 | /** |
| 2750 | * Returns by value, unit of power: horsepower. |
| 2751 | * Also see {@link #createHorsepower()}. |
| 2752 | * @stable ICU 64 |
| 2753 | */ |
| 2754 | static MeasureUnit getHorsepower(); |
| 2755 | |
| 2756 | /** |
| 2757 | * Returns by pointer, unit of power: kilowatt. |
| 2758 | * Caller owns returned value and must free it. |
| 2759 | * Also see {@link #getKilowatt()}. |
| 2760 | * @param status ICU error code. |
| 2761 | * @stable ICU 53 |
| 2762 | */ |
| 2763 | static MeasureUnit *createKilowatt(UErrorCode &status); |
| 2764 | |
| 2765 | /** |
| 2766 | * Returns by value, unit of power: kilowatt. |
| 2767 | * Also see {@link #createKilowatt()}. |
| 2768 | * @stable ICU 64 |
| 2769 | */ |
| 2770 | static MeasureUnit getKilowatt(); |
| 2771 | |
| 2772 | /** |
| 2773 | * Returns by pointer, unit of power: megawatt. |
| 2774 | * Caller owns returned value and must free it. |
| 2775 | * Also see {@link #getMegawatt()}. |
| 2776 | * @param status ICU error code. |
| 2777 | * @stable ICU 54 |
| 2778 | */ |
| 2779 | static MeasureUnit *createMegawatt(UErrorCode &status); |
| 2780 | |
| 2781 | /** |
| 2782 | * Returns by value, unit of power: megawatt. |
| 2783 | * Also see {@link #createMegawatt()}. |
| 2784 | * @stable ICU 64 |
| 2785 | */ |
| 2786 | static MeasureUnit getMegawatt(); |
| 2787 | |
| 2788 | /** |
| 2789 | * Returns by pointer, unit of power: milliwatt. |
| 2790 | * Caller owns returned value and must free it. |
| 2791 | * Also see {@link #getMilliwatt()}. |
| 2792 | * @param status ICU error code. |
| 2793 | * @stable ICU 54 |
| 2794 | */ |
| 2795 | static MeasureUnit *createMilliwatt(UErrorCode &status); |
| 2796 | |
| 2797 | /** |
| 2798 | * Returns by value, unit of power: milliwatt. |
| 2799 | * Also see {@link #createMilliwatt()}. |
| 2800 | * @stable ICU 64 |
| 2801 | */ |
| 2802 | static MeasureUnit getMilliwatt(); |
| 2803 | |
| 2804 | /** |
| 2805 | * Returns by pointer, unit of power: watt. |
| 2806 | * Caller owns returned value and must free it. |
| 2807 | * Also see {@link #getWatt()}. |
| 2808 | * @param status ICU error code. |
| 2809 | * @stable ICU 53 |
| 2810 | */ |
| 2811 | static MeasureUnit *createWatt(UErrorCode &status); |
| 2812 | |
| 2813 | /** |
| 2814 | * Returns by value, unit of power: watt. |
| 2815 | * Also see {@link #createWatt()}. |
| 2816 | * @stable ICU 64 |
| 2817 | */ |
| 2818 | static MeasureUnit getWatt(); |
| 2819 | |
| 2820 | /** |
| 2821 | * Returns by pointer, unit of pressure: atmosphere. |
| 2822 | * Caller owns returned value and must free it. |
| 2823 | * Also see {@link #getAtmosphere()}. |
| 2824 | * @param status ICU error code. |
| 2825 | * @stable ICU 63 |
| 2826 | */ |
| 2827 | static MeasureUnit *createAtmosphere(UErrorCode &status); |
| 2828 | |
| 2829 | /** |
| 2830 | * Returns by value, unit of pressure: atmosphere. |
| 2831 | * Also see {@link #createAtmosphere()}. |
| 2832 | * @stable ICU 64 |
| 2833 | */ |
| 2834 | static MeasureUnit getAtmosphere(); |
| 2835 | |
| 2836 | /** |
| 2837 | * Returns by pointer, unit of pressure: bar. |
| 2838 | * Caller owns returned value and must free it. |
| 2839 | * Also see {@link #getBar()}. |
| 2840 | * @param status ICU error code. |
| 2841 | * @stable ICU 65 |
| 2842 | */ |
| 2843 | static MeasureUnit *createBar(UErrorCode &status); |
| 2844 | |
| 2845 | /** |
| 2846 | * Returns by value, unit of pressure: bar. |
| 2847 | * Also see {@link #createBar()}. |
| 2848 | * @stable ICU 65 |
| 2849 | */ |
| 2850 | static MeasureUnit getBar(); |
| 2851 | |
| 2852 | /** |
| 2853 | * Returns by pointer, unit of pressure: hectopascal. |
| 2854 | * Caller owns returned value and must free it. |
| 2855 | * Also see {@link #getHectopascal()}. |
| 2856 | * @param status ICU error code. |
| 2857 | * @stable ICU 53 |
| 2858 | */ |
| 2859 | static MeasureUnit *createHectopascal(UErrorCode &status); |
| 2860 | |
| 2861 | /** |
| 2862 | * Returns by value, unit of pressure: hectopascal. |
| 2863 | * Also see {@link #createHectopascal()}. |
| 2864 | * @stable ICU 64 |
| 2865 | */ |
| 2866 | static MeasureUnit getHectopascal(); |
| 2867 | |
| 2868 | /** |
| 2869 | * Returns by pointer, unit of pressure: inch-ofhg. |
| 2870 | * Caller owns returned value and must free it. |
| 2871 | * Also see {@link #getInchHg()}. |
| 2872 | * @param status ICU error code. |
| 2873 | * @stable ICU 53 |
| 2874 | */ |
| 2875 | static MeasureUnit *createInchHg(UErrorCode &status); |
| 2876 | |
| 2877 | /** |
| 2878 | * Returns by value, unit of pressure: inch-ofhg. |
| 2879 | * Also see {@link #createInchHg()}. |
| 2880 | * @stable ICU 64 |
| 2881 | */ |
| 2882 | static MeasureUnit getInchHg(); |
| 2883 | |
| 2884 | /** |
| 2885 | * Returns by pointer, unit of pressure: kilopascal. |
| 2886 | * Caller owns returned value and must free it. |
| 2887 | * Also see {@link #getKilopascal()}. |
| 2888 | * @param status ICU error code. |
| 2889 | * @stable ICU 64 |
| 2890 | */ |
| 2891 | static MeasureUnit *createKilopascal(UErrorCode &status); |
| 2892 | |
| 2893 | /** |
| 2894 | * Returns by value, unit of pressure: kilopascal. |
| 2895 | * Also see {@link #createKilopascal()}. |
| 2896 | * @stable ICU 64 |
| 2897 | */ |
| 2898 | static MeasureUnit getKilopascal(); |
| 2899 | |
| 2900 | /** |
| 2901 | * Returns by pointer, unit of pressure: megapascal. |
| 2902 | * Caller owns returned value and must free it. |
| 2903 | * Also see {@link #getMegapascal()}. |
| 2904 | * @param status ICU error code. |
| 2905 | * @stable ICU 64 |
| 2906 | */ |
| 2907 | static MeasureUnit *createMegapascal(UErrorCode &status); |
| 2908 | |
| 2909 | /** |
| 2910 | * Returns by value, unit of pressure: megapascal. |
| 2911 | * Also see {@link #createMegapascal()}. |
| 2912 | * @stable ICU 64 |
| 2913 | */ |
| 2914 | static MeasureUnit getMegapascal(); |
| 2915 | |
| 2916 | /** |
| 2917 | * Returns by pointer, unit of pressure: millibar. |
| 2918 | * Caller owns returned value and must free it. |
| 2919 | * Also see {@link #getMillibar()}. |
| 2920 | * @param status ICU error code. |
| 2921 | * @stable ICU 53 |
| 2922 | */ |
| 2923 | static MeasureUnit *createMillibar(UErrorCode &status); |
| 2924 | |
| 2925 | /** |
| 2926 | * Returns by value, unit of pressure: millibar. |
| 2927 | * Also see {@link #createMillibar()}. |
| 2928 | * @stable ICU 64 |
| 2929 | */ |
| 2930 | static MeasureUnit getMillibar(); |
| 2931 | |
| 2932 | /** |
| 2933 | * Returns by pointer, unit of pressure: millimeter-ofhg. |
| 2934 | * Caller owns returned value and must free it. |
| 2935 | * Also see {@link #getMillimeterOfMercury()}. |
| 2936 | * @param status ICU error code. |
| 2937 | * @stable ICU 54 |
| 2938 | */ |
| 2939 | static MeasureUnit *createMillimeterOfMercury(UErrorCode &status); |
| 2940 | |
| 2941 | /** |
| 2942 | * Returns by value, unit of pressure: millimeter-ofhg. |
| 2943 | * Also see {@link #createMillimeterOfMercury()}. |
| 2944 | * @stable ICU 64 |
| 2945 | */ |
| 2946 | static MeasureUnit getMillimeterOfMercury(); |
| 2947 | |
| 2948 | /** |
| 2949 | * Returns by pointer, unit of pressure: pascal. |
| 2950 | * Caller owns returned value and must free it. |
| 2951 | * Also see {@link #getPascal()}. |
| 2952 | * @param status ICU error code. |
| 2953 | * @stable ICU 65 |
| 2954 | */ |
| 2955 | static MeasureUnit *createPascal(UErrorCode &status); |
| 2956 | |
| 2957 | /** |
| 2958 | * Returns by value, unit of pressure: pascal. |
| 2959 | * Also see {@link #createPascal()}. |
| 2960 | * @stable ICU 65 |
| 2961 | */ |
| 2962 | static MeasureUnit getPascal(); |
| 2963 | |
| 2964 | /** |
| 2965 | * Returns by pointer, unit of pressure: pound-force-per-square-inch. |
| 2966 | * Caller owns returned value and must free it. |
| 2967 | * Also see {@link #getPoundPerSquareInch()}. |
| 2968 | * @param status ICU error code. |
| 2969 | * @stable ICU 54 |
| 2970 | */ |
| 2971 | static MeasureUnit *createPoundPerSquareInch(UErrorCode &status); |
| 2972 | |
| 2973 | /** |
| 2974 | * Returns by value, unit of pressure: pound-force-per-square-inch. |
| 2975 | * Also see {@link #createPoundPerSquareInch()}. |
| 2976 | * @stable ICU 64 |
| 2977 | */ |
| 2978 | static MeasureUnit getPoundPerSquareInch(); |
| 2979 | |
| 2980 | /** |
| 2981 | * Returns by pointer, unit of speed: kilometer-per-hour. |
| 2982 | * Caller owns returned value and must free it. |
| 2983 | * Also see {@link #getKilometerPerHour()}. |
| 2984 | * @param status ICU error code. |
| 2985 | * @stable ICU 53 |
| 2986 | */ |
| 2987 | static MeasureUnit *createKilometerPerHour(UErrorCode &status); |
| 2988 | |
| 2989 | /** |
| 2990 | * Returns by value, unit of speed: kilometer-per-hour. |
| 2991 | * Also see {@link #createKilometerPerHour()}. |
| 2992 | * @stable ICU 64 |
| 2993 | */ |
| 2994 | static MeasureUnit getKilometerPerHour(); |
| 2995 | |
| 2996 | /** |
| 2997 | * Returns by pointer, unit of speed: knot. |
| 2998 | * Caller owns returned value and must free it. |
| 2999 | * Also see {@link #getKnot()}. |
| 3000 | * @param status ICU error code. |
| 3001 | * @stable ICU 56 |
| 3002 | */ |
| 3003 | static MeasureUnit *createKnot(UErrorCode &status); |
| 3004 | |
| 3005 | /** |
| 3006 | * Returns by value, unit of speed: knot. |
| 3007 | * Also see {@link #createKnot()}. |
| 3008 | * @stable ICU 64 |
| 3009 | */ |
| 3010 | static MeasureUnit getKnot(); |
| 3011 | |
| 3012 | /** |
| 3013 | * Returns by pointer, unit of speed: meter-per-second. |
| 3014 | * Caller owns returned value and must free it. |
| 3015 | * Also see {@link #getMeterPerSecond()}. |
| 3016 | * @param status ICU error code. |
| 3017 | * @stable ICU 53 |
| 3018 | */ |
| 3019 | static MeasureUnit *createMeterPerSecond(UErrorCode &status); |
| 3020 | |
| 3021 | /** |
| 3022 | * Returns by value, unit of speed: meter-per-second. |
| 3023 | * Also see {@link #createMeterPerSecond()}. |
| 3024 | * @stable ICU 64 |
| 3025 | */ |
| 3026 | static MeasureUnit getMeterPerSecond(); |
| 3027 | |
| 3028 | /** |
| 3029 | * Returns by pointer, unit of speed: mile-per-hour. |
| 3030 | * Caller owns returned value and must free it. |
| 3031 | * Also see {@link #getMilePerHour()}. |
| 3032 | * @param status ICU error code. |
| 3033 | * @stable ICU 53 |
| 3034 | */ |
| 3035 | static MeasureUnit *createMilePerHour(UErrorCode &status); |
| 3036 | |
| 3037 | /** |
| 3038 | * Returns by value, unit of speed: mile-per-hour. |
| 3039 | * Also see {@link #createMilePerHour()}. |
| 3040 | * @stable ICU 64 |
| 3041 | */ |
| 3042 | static MeasureUnit getMilePerHour(); |
| 3043 | |
| 3044 | /** |
| 3045 | * Returns by pointer, unit of temperature: celsius. |
| 3046 | * Caller owns returned value and must free it. |
| 3047 | * Also see {@link #getCelsius()}. |
| 3048 | * @param status ICU error code. |
| 3049 | * @stable ICU 53 |
| 3050 | */ |
| 3051 | static MeasureUnit *createCelsius(UErrorCode &status); |
| 3052 | |
| 3053 | /** |
| 3054 | * Returns by value, unit of temperature: celsius. |
| 3055 | * Also see {@link #createCelsius()}. |
| 3056 | * @stable ICU 64 |
| 3057 | */ |
| 3058 | static MeasureUnit getCelsius(); |
| 3059 | |
| 3060 | /** |
| 3061 | * Returns by pointer, unit of temperature: fahrenheit. |
| 3062 | * Caller owns returned value and must free it. |
| 3063 | * Also see {@link #getFahrenheit()}. |
| 3064 | * @param status ICU error code. |
| 3065 | * @stable ICU 53 |
| 3066 | */ |
| 3067 | static MeasureUnit *createFahrenheit(UErrorCode &status); |
| 3068 | |
| 3069 | /** |
| 3070 | * Returns by value, unit of temperature: fahrenheit. |
| 3071 | * Also see {@link #createFahrenheit()}. |
| 3072 | * @stable ICU 64 |
| 3073 | */ |
| 3074 | static MeasureUnit getFahrenheit(); |
| 3075 | |
| 3076 | /** |
| 3077 | * Returns by pointer, unit of temperature: generic. |
| 3078 | * Caller owns returned value and must free it. |
| 3079 | * Also see {@link #getGenericTemperature()}. |
| 3080 | * @param status ICU error code. |
| 3081 | * @stable ICU 56 |
| 3082 | */ |
| 3083 | static MeasureUnit *createGenericTemperature(UErrorCode &status); |
| 3084 | |
| 3085 | /** |
| 3086 | * Returns by value, unit of temperature: generic. |
| 3087 | * Also see {@link #createGenericTemperature()}. |
| 3088 | * @stable ICU 64 |
| 3089 | */ |
| 3090 | static MeasureUnit getGenericTemperature(); |
| 3091 | |
| 3092 | /** |
| 3093 | * Returns by pointer, unit of temperature: kelvin. |
| 3094 | * Caller owns returned value and must free it. |
| 3095 | * Also see {@link #getKelvin()}. |
| 3096 | * @param status ICU error code. |
| 3097 | * @stable ICU 54 |
| 3098 | */ |
| 3099 | static MeasureUnit *createKelvin(UErrorCode &status); |
| 3100 | |
| 3101 | /** |
| 3102 | * Returns by value, unit of temperature: kelvin. |
| 3103 | * Also see {@link #createKelvin()}. |
| 3104 | * @stable ICU 64 |
| 3105 | */ |
| 3106 | static MeasureUnit getKelvin(); |
| 3107 | |
| 3108 | /** |
| 3109 | * Returns by pointer, unit of torque: newton-meter. |
| 3110 | * Caller owns returned value and must free it. |
| 3111 | * Also see {@link #getNewtonMeter()}. |
| 3112 | * @param status ICU error code. |
| 3113 | * @stable ICU 64 |
| 3114 | */ |
| 3115 | static MeasureUnit *createNewtonMeter(UErrorCode &status); |
| 3116 | |
| 3117 | /** |
| 3118 | * Returns by value, unit of torque: newton-meter. |
| 3119 | * Also see {@link #createNewtonMeter()}. |
| 3120 | * @stable ICU 64 |
| 3121 | */ |
| 3122 | static MeasureUnit getNewtonMeter(); |
| 3123 | |
| 3124 | /** |
| 3125 | * Returns by pointer, unit of torque: pound-force-foot. |
| 3126 | * Caller owns returned value and must free it. |
| 3127 | * Also see {@link #getPoundFoot()}. |
| 3128 | * @param status ICU error code. |
| 3129 | * @stable ICU 64 |
| 3130 | */ |
| 3131 | static MeasureUnit *(UErrorCode &status); |
| 3132 | |
| 3133 | /** |
| 3134 | * Returns by value, unit of torque: pound-force-foot. |
| 3135 | * Also see {@link #createPoundFoot()}. |
| 3136 | * @stable ICU 64 |
| 3137 | */ |
| 3138 | static MeasureUnit (); |
| 3139 | |
| 3140 | /** |
| 3141 | * Returns by pointer, unit of volume: acre-foot. |
| 3142 | * Caller owns returned value and must free it. |
| 3143 | * Also see {@link #getAcreFoot()}. |
| 3144 | * @param status ICU error code. |
| 3145 | * @stable ICU 54 |
| 3146 | */ |
| 3147 | static MeasureUnit *(UErrorCode &status); |
| 3148 | |
| 3149 | /** |
| 3150 | * Returns by value, unit of volume: acre-foot. |
| 3151 | * Also see {@link #createAcreFoot()}. |
| 3152 | * @stable ICU 64 |
| 3153 | */ |
| 3154 | static MeasureUnit (); |
| 3155 | |
| 3156 | /** |
| 3157 | * Returns by pointer, unit of volume: barrel. |
| 3158 | * Caller owns returned value and must free it. |
| 3159 | * Also see {@link #getBarrel()}. |
| 3160 | * @param status ICU error code. |
| 3161 | * @stable ICU 64 |
| 3162 | */ |
| 3163 | static MeasureUnit *createBarrel(UErrorCode &status); |
| 3164 | |
| 3165 | /** |
| 3166 | * Returns by value, unit of volume: barrel. |
| 3167 | * Also see {@link #createBarrel()}. |
| 3168 | * @stable ICU 64 |
| 3169 | */ |
| 3170 | static MeasureUnit getBarrel(); |
| 3171 | |
| 3172 | /** |
| 3173 | * Returns by pointer, unit of volume: bushel. |
| 3174 | * Caller owns returned value and must free it. |
| 3175 | * Also see {@link #getBushel()}. |
| 3176 | * @param status ICU error code. |
| 3177 | * @stable ICU 54 |
| 3178 | */ |
| 3179 | static MeasureUnit *createBushel(UErrorCode &status); |
| 3180 | |
| 3181 | /** |
| 3182 | * Returns by value, unit of volume: bushel. |
| 3183 | * Also see {@link #createBushel()}. |
| 3184 | * @stable ICU 64 |
| 3185 | */ |
| 3186 | static MeasureUnit getBushel(); |
| 3187 | |
| 3188 | /** |
| 3189 | * Returns by pointer, unit of volume: centiliter. |
| 3190 | * Caller owns returned value and must free it. |
| 3191 | * Also see {@link #getCentiliter()}. |
| 3192 | * @param status ICU error code. |
| 3193 | * @stable ICU 54 |
| 3194 | */ |
| 3195 | static MeasureUnit *createCentiliter(UErrorCode &status); |
| 3196 | |
| 3197 | /** |
| 3198 | * Returns by value, unit of volume: centiliter. |
| 3199 | * Also see {@link #createCentiliter()}. |
| 3200 | * @stable ICU 64 |
| 3201 | */ |
| 3202 | static MeasureUnit getCentiliter(); |
| 3203 | |
| 3204 | /** |
| 3205 | * Returns by pointer, unit of volume: cubic-centimeter. |
| 3206 | * Caller owns returned value and must free it. |
| 3207 | * Also see {@link #getCubicCentimeter()}. |
| 3208 | * @param status ICU error code. |
| 3209 | * @stable ICU 54 |
| 3210 | */ |
| 3211 | static MeasureUnit *createCubicCentimeter(UErrorCode &status); |
| 3212 | |
| 3213 | /** |
| 3214 | * Returns by value, unit of volume: cubic-centimeter. |
| 3215 | * Also see {@link #createCubicCentimeter()}. |
| 3216 | * @stable ICU 64 |
| 3217 | */ |
| 3218 | static MeasureUnit getCubicCentimeter(); |
| 3219 | |
| 3220 | /** |
| 3221 | * Returns by pointer, unit of volume: cubic-foot. |
| 3222 | * Caller owns returned value and must free it. |
| 3223 | * Also see {@link #getCubicFoot()}. |
| 3224 | * @param status ICU error code. |
| 3225 | * @stable ICU 54 |
| 3226 | */ |
| 3227 | static MeasureUnit *(UErrorCode &status); |
| 3228 | |
| 3229 | /** |
| 3230 | * Returns by value, unit of volume: cubic-foot. |
| 3231 | * Also see {@link #createCubicFoot()}. |
| 3232 | * @stable ICU 64 |
| 3233 | */ |
| 3234 | static MeasureUnit (); |
| 3235 | |
| 3236 | /** |
| 3237 | * Returns by pointer, unit of volume: cubic-inch. |
| 3238 | * Caller owns returned value and must free it. |
| 3239 | * Also see {@link #getCubicInch()}. |
| 3240 | * @param status ICU error code. |
| 3241 | * @stable ICU 54 |
| 3242 | */ |
| 3243 | static MeasureUnit *createCubicInch(UErrorCode &status); |
| 3244 | |
| 3245 | /** |
| 3246 | * Returns by value, unit of volume: cubic-inch. |
| 3247 | * Also see {@link #createCubicInch()}. |
| 3248 | * @stable ICU 64 |
| 3249 | */ |
| 3250 | static MeasureUnit getCubicInch(); |
| 3251 | |
| 3252 | /** |
| 3253 | * Returns by pointer, unit of volume: cubic-kilometer. |
| 3254 | * Caller owns returned value and must free it. |
| 3255 | * Also see {@link #getCubicKilometer()}. |
| 3256 | * @param status ICU error code. |
| 3257 | * @stable ICU 53 |
| 3258 | */ |
| 3259 | static MeasureUnit *createCubicKilometer(UErrorCode &status); |
| 3260 | |
| 3261 | /** |
| 3262 | * Returns by value, unit of volume: cubic-kilometer. |
| 3263 | * Also see {@link #createCubicKilometer()}. |
| 3264 | * @stable ICU 64 |
| 3265 | */ |
| 3266 | static MeasureUnit getCubicKilometer(); |
| 3267 | |
| 3268 | /** |
| 3269 | * Returns by pointer, unit of volume: cubic-meter. |
| 3270 | * Caller owns returned value and must free it. |
| 3271 | * Also see {@link #getCubicMeter()}. |
| 3272 | * @param status ICU error code. |
| 3273 | * @stable ICU 54 |
| 3274 | */ |
| 3275 | static MeasureUnit *createCubicMeter(UErrorCode &status); |
| 3276 | |
| 3277 | /** |
| 3278 | * Returns by value, unit of volume: cubic-meter. |
| 3279 | * Also see {@link #createCubicMeter()}. |
| 3280 | * @stable ICU 64 |
| 3281 | */ |
| 3282 | static MeasureUnit getCubicMeter(); |
| 3283 | |
| 3284 | /** |
| 3285 | * Returns by pointer, unit of volume: cubic-mile. |
| 3286 | * Caller owns returned value and must free it. |
| 3287 | * Also see {@link #getCubicMile()}. |
| 3288 | * @param status ICU error code. |
| 3289 | * @stable ICU 53 |
| 3290 | */ |
| 3291 | static MeasureUnit *createCubicMile(UErrorCode &status); |
| 3292 | |
| 3293 | /** |
| 3294 | * Returns by value, unit of volume: cubic-mile. |
| 3295 | * Also see {@link #createCubicMile()}. |
| 3296 | * @stable ICU 64 |
| 3297 | */ |
| 3298 | static MeasureUnit getCubicMile(); |
| 3299 | |
| 3300 | /** |
| 3301 | * Returns by pointer, unit of volume: cubic-yard. |
| 3302 | * Caller owns returned value and must free it. |
| 3303 | * Also see {@link #getCubicYard()}. |
| 3304 | * @param status ICU error code. |
| 3305 | * @stable ICU 54 |
| 3306 | */ |
| 3307 | static MeasureUnit *createCubicYard(UErrorCode &status); |
| 3308 | |
| 3309 | /** |
| 3310 | * Returns by value, unit of volume: cubic-yard. |
| 3311 | * Also see {@link #createCubicYard()}. |
| 3312 | * @stable ICU 64 |
| 3313 | */ |
| 3314 | static MeasureUnit getCubicYard(); |
| 3315 | |
| 3316 | /** |
| 3317 | * Returns by pointer, unit of volume: cup. |
| 3318 | * Caller owns returned value and must free it. |
| 3319 | * Also see {@link #getCup()}. |
| 3320 | * @param status ICU error code. |
| 3321 | * @stable ICU 54 |
| 3322 | */ |
| 3323 | static MeasureUnit *createCup(UErrorCode &status); |
| 3324 | |
| 3325 | /** |
| 3326 | * Returns by value, unit of volume: cup. |
| 3327 | * Also see {@link #createCup()}. |
| 3328 | * @stable ICU 64 |
| 3329 | */ |
| 3330 | static MeasureUnit getCup(); |
| 3331 | |
| 3332 | /** |
| 3333 | * Returns by pointer, unit of volume: cup-metric. |
| 3334 | * Caller owns returned value and must free it. |
| 3335 | * Also see {@link #getCupMetric()}. |
| 3336 | * @param status ICU error code. |
| 3337 | * @stable ICU 56 |
| 3338 | */ |
| 3339 | static MeasureUnit *createCupMetric(UErrorCode &status); |
| 3340 | |
| 3341 | /** |
| 3342 | * Returns by value, unit of volume: cup-metric. |
| 3343 | * Also see {@link #createCupMetric()}. |
| 3344 | * @stable ICU 64 |
| 3345 | */ |
| 3346 | static MeasureUnit getCupMetric(); |
| 3347 | |
| 3348 | /** |
| 3349 | * Returns by pointer, unit of volume: deciliter. |
| 3350 | * Caller owns returned value and must free it. |
| 3351 | * Also see {@link #getDeciliter()}. |
| 3352 | * @param status ICU error code. |
| 3353 | * @stable ICU 54 |
| 3354 | */ |
| 3355 | static MeasureUnit *createDeciliter(UErrorCode &status); |
| 3356 | |
| 3357 | /** |
| 3358 | * Returns by value, unit of volume: deciliter. |
| 3359 | * Also see {@link #createDeciliter()}. |
| 3360 | * @stable ICU 64 |
| 3361 | */ |
| 3362 | static MeasureUnit getDeciliter(); |
| 3363 | |
| 3364 | /** |
| 3365 | * Returns by pointer, unit of volume: dessert-spoon. |
| 3366 | * Caller owns returned value and must free it. |
| 3367 | * Also see {@link #getDessertSpoon()}. |
| 3368 | * @param status ICU error code. |
| 3369 | * @stable ICU 68 |
| 3370 | */ |
| 3371 | static MeasureUnit *createDessertSpoon(UErrorCode &status); |
| 3372 | |
| 3373 | /** |
| 3374 | * Returns by value, unit of volume: dessert-spoon. |
| 3375 | * Also see {@link #createDessertSpoon()}. |
| 3376 | * @stable ICU 68 |
| 3377 | */ |
| 3378 | static MeasureUnit getDessertSpoon(); |
| 3379 | |
| 3380 | /** |
| 3381 | * Returns by pointer, unit of volume: dessert-spoon-imperial. |
| 3382 | * Caller owns returned value and must free it. |
| 3383 | * Also see {@link #getDessertSpoonImperial()}. |
| 3384 | * @param status ICU error code. |
| 3385 | * @stable ICU 68 |
| 3386 | */ |
| 3387 | static MeasureUnit *createDessertSpoonImperial(UErrorCode &status); |
| 3388 | |
| 3389 | /** |
| 3390 | * Returns by value, unit of volume: dessert-spoon-imperial. |
| 3391 | * Also see {@link #createDessertSpoonImperial()}. |
| 3392 | * @stable ICU 68 |
| 3393 | */ |
| 3394 | static MeasureUnit getDessertSpoonImperial(); |
| 3395 | |
| 3396 | /** |
| 3397 | * Returns by pointer, unit of volume: dram. |
| 3398 | * Caller owns returned value and must free it. |
| 3399 | * Also see {@link #getDram()}. |
| 3400 | * @param status ICU error code. |
| 3401 | * @stable ICU 68 |
| 3402 | */ |
| 3403 | static MeasureUnit *createDram(UErrorCode &status); |
| 3404 | |
| 3405 | /** |
| 3406 | * Returns by value, unit of volume: dram. |
| 3407 | * Also see {@link #createDram()}. |
| 3408 | * @stable ICU 68 |
| 3409 | */ |
| 3410 | static MeasureUnit getDram(); |
| 3411 | |
| 3412 | /** |
| 3413 | * Returns by pointer, unit of volume: drop. |
| 3414 | * Caller owns returned value and must free it. |
| 3415 | * Also see {@link #getDrop()}. |
| 3416 | * @param status ICU error code. |
| 3417 | * @stable ICU 68 |
| 3418 | */ |
| 3419 | static MeasureUnit *createDrop(UErrorCode &status); |
| 3420 | |
| 3421 | /** |
| 3422 | * Returns by value, unit of volume: drop. |
| 3423 | * Also see {@link #createDrop()}. |
| 3424 | * @stable ICU 68 |
| 3425 | */ |
| 3426 | static MeasureUnit getDrop(); |
| 3427 | |
| 3428 | /** |
| 3429 | * Returns by pointer, unit of volume: fluid-ounce. |
| 3430 | * Caller owns returned value and must free it. |
| 3431 | * Also see {@link #getFluidOunce()}. |
| 3432 | * @param status ICU error code. |
| 3433 | * @stable ICU 54 |
| 3434 | */ |
| 3435 | static MeasureUnit *createFluidOunce(UErrorCode &status); |
| 3436 | |
| 3437 | /** |
| 3438 | * Returns by value, unit of volume: fluid-ounce. |
| 3439 | * Also see {@link #createFluidOunce()}. |
| 3440 | * @stable ICU 64 |
| 3441 | */ |
| 3442 | static MeasureUnit getFluidOunce(); |
| 3443 | |
| 3444 | /** |
| 3445 | * Returns by pointer, unit of volume: fluid-ounce-imperial. |
| 3446 | * Caller owns returned value and must free it. |
| 3447 | * Also see {@link #getFluidOunceImperial()}. |
| 3448 | * @param status ICU error code. |
| 3449 | * @stable ICU 64 |
| 3450 | */ |
| 3451 | static MeasureUnit *createFluidOunceImperial(UErrorCode &status); |
| 3452 | |
| 3453 | /** |
| 3454 | * Returns by value, unit of volume: fluid-ounce-imperial. |
| 3455 | * Also see {@link #createFluidOunceImperial()}. |
| 3456 | * @stable ICU 64 |
| 3457 | */ |
| 3458 | static MeasureUnit getFluidOunceImperial(); |
| 3459 | |
| 3460 | /** |
| 3461 | * Returns by pointer, unit of volume: gallon. |
| 3462 | * Caller owns returned value and must free it. |
| 3463 | * Also see {@link #getGallon()}. |
| 3464 | * @param status ICU error code. |
| 3465 | * @stable ICU 54 |
| 3466 | */ |
| 3467 | static MeasureUnit *createGallon(UErrorCode &status); |
| 3468 | |
| 3469 | /** |
| 3470 | * Returns by value, unit of volume: gallon. |
| 3471 | * Also see {@link #createGallon()}. |
| 3472 | * @stable ICU 64 |
| 3473 | */ |
| 3474 | static MeasureUnit getGallon(); |
| 3475 | |
| 3476 | /** |
| 3477 | * Returns by pointer, unit of volume: gallon-imperial. |
| 3478 | * Caller owns returned value and must free it. |
| 3479 | * Also see {@link #getGallonImperial()}. |
| 3480 | * @param status ICU error code. |
| 3481 | * @stable ICU 57 |
| 3482 | */ |
| 3483 | static MeasureUnit *createGallonImperial(UErrorCode &status); |
| 3484 | |
| 3485 | /** |
| 3486 | * Returns by value, unit of volume: gallon-imperial. |
| 3487 | * Also see {@link #createGallonImperial()}. |
| 3488 | * @stable ICU 64 |
| 3489 | */ |
| 3490 | static MeasureUnit getGallonImperial(); |
| 3491 | |
| 3492 | /** |
| 3493 | * Returns by pointer, unit of volume: hectoliter. |
| 3494 | * Caller owns returned value and must free it. |
| 3495 | * Also see {@link #getHectoliter()}. |
| 3496 | * @param status ICU error code. |
| 3497 | * @stable ICU 54 |
| 3498 | */ |
| 3499 | static MeasureUnit *createHectoliter(UErrorCode &status); |
| 3500 | |
| 3501 | /** |
| 3502 | * Returns by value, unit of volume: hectoliter. |
| 3503 | * Also see {@link #createHectoliter()}. |
| 3504 | * @stable ICU 64 |
| 3505 | */ |
| 3506 | static MeasureUnit getHectoliter(); |
| 3507 | |
| 3508 | /** |
| 3509 | * Returns by pointer, unit of volume: jigger. |
| 3510 | * Caller owns returned value and must free it. |
| 3511 | * Also see {@link #getJigger()}. |
| 3512 | * @param status ICU error code. |
| 3513 | * @stable ICU 68 |
| 3514 | */ |
| 3515 | static MeasureUnit *createJigger(UErrorCode &status); |
| 3516 | |
| 3517 | /** |
| 3518 | * Returns by value, unit of volume: jigger. |
| 3519 | * Also see {@link #createJigger()}. |
| 3520 | * @stable ICU 68 |
| 3521 | */ |
| 3522 | static MeasureUnit getJigger(); |
| 3523 | |
| 3524 | /** |
| 3525 | * Returns by pointer, unit of volume: liter. |
| 3526 | * Caller owns returned value and must free it. |
| 3527 | * Also see {@link #getLiter()}. |
| 3528 | * @param status ICU error code. |
| 3529 | * @stable ICU 53 |
| 3530 | */ |
| 3531 | static MeasureUnit *createLiter(UErrorCode &status); |
| 3532 | |
| 3533 | /** |
| 3534 | * Returns by value, unit of volume: liter. |
| 3535 | * Also see {@link #createLiter()}. |
| 3536 | * @stable ICU 64 |
| 3537 | */ |
| 3538 | static MeasureUnit getLiter(); |
| 3539 | |
| 3540 | /** |
| 3541 | * Returns by pointer, unit of volume: megaliter. |
| 3542 | * Caller owns returned value and must free it. |
| 3543 | * Also see {@link #getMegaliter()}. |
| 3544 | * @param status ICU error code. |
| 3545 | * @stable ICU 54 |
| 3546 | */ |
| 3547 | static MeasureUnit *createMegaliter(UErrorCode &status); |
| 3548 | |
| 3549 | /** |
| 3550 | * Returns by value, unit of volume: megaliter. |
| 3551 | * Also see {@link #createMegaliter()}. |
| 3552 | * @stable ICU 64 |
| 3553 | */ |
| 3554 | static MeasureUnit getMegaliter(); |
| 3555 | |
| 3556 | /** |
| 3557 | * Returns by pointer, unit of volume: milliliter. |
| 3558 | * Caller owns returned value and must free it. |
| 3559 | * Also see {@link #getMilliliter()}. |
| 3560 | * @param status ICU error code. |
| 3561 | * @stable ICU 54 |
| 3562 | */ |
| 3563 | static MeasureUnit *createMilliliter(UErrorCode &status); |
| 3564 | |
| 3565 | /** |
| 3566 | * Returns by value, unit of volume: milliliter. |
| 3567 | * Also see {@link #createMilliliter()}. |
| 3568 | * @stable ICU 64 |
| 3569 | */ |
| 3570 | static MeasureUnit getMilliliter(); |
| 3571 | |
| 3572 | /** |
| 3573 | * Returns by pointer, unit of volume: pinch. |
| 3574 | * Caller owns returned value and must free it. |
| 3575 | * Also see {@link #getPinch()}. |
| 3576 | * @param status ICU error code. |
| 3577 | * @stable ICU 68 |
| 3578 | */ |
| 3579 | static MeasureUnit *createPinch(UErrorCode &status); |
| 3580 | |
| 3581 | /** |
| 3582 | * Returns by value, unit of volume: pinch. |
| 3583 | * Also see {@link #createPinch()}. |
| 3584 | * @stable ICU 68 |
| 3585 | */ |
| 3586 | static MeasureUnit getPinch(); |
| 3587 | |
| 3588 | /** |
| 3589 | * Returns by pointer, unit of volume: pint. |
| 3590 | * Caller owns returned value and must free it. |
| 3591 | * Also see {@link #getPint()}. |
| 3592 | * @param status ICU error code. |
| 3593 | * @stable ICU 54 |
| 3594 | */ |
| 3595 | static MeasureUnit *createPint(UErrorCode &status); |
| 3596 | |
| 3597 | /** |
| 3598 | * Returns by value, unit of volume: pint. |
| 3599 | * Also see {@link #createPint()}. |
| 3600 | * @stable ICU 64 |
| 3601 | */ |
| 3602 | static MeasureUnit getPint(); |
| 3603 | |
| 3604 | /** |
| 3605 | * Returns by pointer, unit of volume: pint-metric. |
| 3606 | * Caller owns returned value and must free it. |
| 3607 | * Also see {@link #getPintMetric()}. |
| 3608 | * @param status ICU error code. |
| 3609 | * @stable ICU 56 |
| 3610 | */ |
| 3611 | static MeasureUnit *createPintMetric(UErrorCode &status); |
| 3612 | |
| 3613 | /** |
| 3614 | * Returns by value, unit of volume: pint-metric. |
| 3615 | * Also see {@link #createPintMetric()}. |
| 3616 | * @stable ICU 64 |
| 3617 | */ |
| 3618 | static MeasureUnit getPintMetric(); |
| 3619 | |
| 3620 | /** |
| 3621 | * Returns by pointer, unit of volume: quart. |
| 3622 | * Caller owns returned value and must free it. |
| 3623 | * Also see {@link #getQuart()}. |
| 3624 | * @param status ICU error code. |
| 3625 | * @stable ICU 54 |
| 3626 | */ |
| 3627 | static MeasureUnit *createQuart(UErrorCode &status); |
| 3628 | |
| 3629 | /** |
| 3630 | * Returns by value, unit of volume: quart. |
| 3631 | * Also see {@link #createQuart()}. |
| 3632 | * @stable ICU 64 |
| 3633 | */ |
| 3634 | static MeasureUnit getQuart(); |
| 3635 | |
| 3636 | /** |
| 3637 | * Returns by pointer, unit of volume: quart-imperial. |
| 3638 | * Caller owns returned value and must free it. |
| 3639 | * Also see {@link #getQuartImperial()}. |
| 3640 | * @param status ICU error code. |
| 3641 | * @stable ICU 68 |
| 3642 | */ |
| 3643 | static MeasureUnit *createQuartImperial(UErrorCode &status); |
| 3644 | |
| 3645 | /** |
| 3646 | * Returns by value, unit of volume: quart-imperial. |
| 3647 | * Also see {@link #createQuartImperial()}. |
| 3648 | * @stable ICU 68 |
| 3649 | */ |
| 3650 | static MeasureUnit getQuartImperial(); |
| 3651 | |
| 3652 | /** |
| 3653 | * Returns by pointer, unit of volume: tablespoon. |
| 3654 | * Caller owns returned value and must free it. |
| 3655 | * Also see {@link #getTablespoon()}. |
| 3656 | * @param status ICU error code. |
| 3657 | * @stable ICU 54 |
| 3658 | */ |
| 3659 | static MeasureUnit *createTablespoon(UErrorCode &status); |
| 3660 | |
| 3661 | /** |
| 3662 | * Returns by value, unit of volume: tablespoon. |
| 3663 | * Also see {@link #createTablespoon()}. |
| 3664 | * @stable ICU 64 |
| 3665 | */ |
| 3666 | static MeasureUnit getTablespoon(); |
| 3667 | |
| 3668 | /** |
| 3669 | * Returns by pointer, unit of volume: teaspoon. |
| 3670 | * Caller owns returned value and must free it. |
| 3671 | * Also see {@link #getTeaspoon()}. |
| 3672 | * @param status ICU error code. |
| 3673 | * @stable ICU 54 |
| 3674 | */ |
| 3675 | static MeasureUnit *createTeaspoon(UErrorCode &status); |
| 3676 | |
| 3677 | /** |
| 3678 | * Returns by value, unit of volume: teaspoon. |
| 3679 | * Also see {@link #createTeaspoon()}. |
| 3680 | * @stable ICU 64 |
| 3681 | */ |
| 3682 | static MeasureUnit getTeaspoon(); |
| 3683 | |
| 3684 | // End generated createXXX methods |
| 3685 | |
| 3686 | protected: |
| 3687 | |
| 3688 | #ifndef U_HIDE_INTERNAL_API |
| 3689 | /** |
| 3690 | * For ICU use only. |
| 3691 | * @internal |
| 3692 | */ |
| 3693 | void initTime(const char *timeId); |
| 3694 | |
| 3695 | /** |
| 3696 | * For ICU use only. |
| 3697 | * @internal |
| 3698 | */ |
| 3699 | void initCurrency(StringPiece isoCurrency); |
| 3700 | |
| 3701 | #endif /* U_HIDE_INTERNAL_API */ |
| 3702 | |
| 3703 | private: |
| 3704 | |
| 3705 | // Used by new draft APIs in ICU 67. If non-null, fImpl is owned by the |
| 3706 | // MeasureUnit. |
| 3707 | MeasureUnitImpl* fImpl; |
| 3708 | |
| 3709 | // An index into a static string list in measunit.cpp. If set to -1, fImpl |
| 3710 | // is in use instead of fTypeId and fSubTypeId. |
| 3711 | int16_t fSubTypeId; |
| 3712 | // An index into a static string list in measunit.cpp. If set to -1, fImpl |
| 3713 | // is in use instead of fTypeId and fSubTypeId. |
| 3714 | int8_t fTypeId; |
| 3715 | |
| 3716 | MeasureUnit(int32_t typeId, int32_t subTypeId); |
| 3717 | MeasureUnit(MeasureUnitImpl&& impl); |
| 3718 | void setTo(int32_t typeId, int32_t subTypeId); |
| 3719 | static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status); |
| 3720 | |
| 3721 | /** |
| 3722 | * Sets output's typeId and subTypeId according to subType, if subType is a |
| 3723 | * valid/known identifier. |
| 3724 | * |
| 3725 | * @return Whether subType is known to ICU. If false, output was not |
| 3726 | * modified. |
| 3727 | */ |
| 3728 | static bool findBySubType(StringPiece subType, MeasureUnit* output); |
| 3729 | |
| 3730 | /** Internal version of public API */ |
| 3731 | LocalArray<MeasureUnit> splitToSingleUnitsImpl(int32_t& outCount, UErrorCode& status) const; |
| 3732 | |
| 3733 | friend class MeasureUnitImpl; |
| 3734 | |
| 3735 | // For access to findBySubType |
| 3736 | friend class number::impl::LongNameHandler; |
| 3737 | }; |
| 3738 | |
| 3739 | // inline impl of @stable ICU 68 method |
| 3740 | inline std::pair<LocalArray<MeasureUnit>, int32_t> |
| 3741 | MeasureUnit::splitToSingleUnits(UErrorCode& status) const { |
| 3742 | int32_t length; |
| 3743 | auto array = splitToSingleUnitsImpl(outCount&: length, status); |
| 3744 | return std::make_pair(x: std::move(array), y&: length); |
| 3745 | } |
| 3746 | |
| 3747 | U_NAMESPACE_END |
| 3748 | |
| 3749 | #endif // !UNCONFIG_NO_FORMATTING |
| 3750 | |
| 3751 | #endif /* U_SHOW_CPLUSPLUS_API */ |
| 3752 | |
| 3753 | #endif // __MEASUREUNIT_H__ |
| 3754 | |