annotate CSP2/CSP2_env/env-d9b9114564458d9d-741b3de822f2aaca6c6caa4325c4afce/include/unicode/measunit.h @ 69:33d812a61356

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