|
||||
File indexing completed on 2024-11-15 09:58:43
0001 // © 2016 and later: Unicode, Inc. and others. 0002 // License & terms of use: http://www.unicode.org/copyright.html 0003 /* 0004 ********************************************************************** 0005 * Copyright (c) 2004-2016, International Business Machines 0006 * Corporation and others. All Rights Reserved. 0007 ********************************************************************** 0008 * Author: Alan Liu 0009 * Created: April 26, 2004 0010 * Since: ICU 3.0 0011 ********************************************************************** 0012 */ 0013 #ifndef __MEASUREUNIT_H__ 0014 #define __MEASUREUNIT_H__ 0015 0016 #include "unicode/utypes.h" 0017 0018 #if U_SHOW_CPLUSPLUS_API 0019 0020 #if !UCONFIG_NO_FORMATTING 0021 0022 #include "unicode/unistr.h" 0023 #include "unicode/localpointer.h" 0024 0025 /** 0026 * \file 0027 * \brief C++ API: A unit for measuring a quantity. 0028 */ 0029 0030 U_NAMESPACE_BEGIN 0031 0032 class StringEnumeration; 0033 struct MeasureUnitImpl; 0034 0035 #ifndef U_HIDE_DRAFT_API 0036 /** 0037 * Enumeration for unit complexity. There are three levels: 0038 * 0039 * - SINGLE: A single unit, optionally with a power and/or SI prefix. Examples: hectare, 0040 * square-kilometer, kilojoule, per-second. 0041 * - COMPOUND: A unit composed of the product of multiple single units. Examples: 0042 * meter-per-second, kilowatt-hour, kilogram-meter-per-square-second. 0043 * - MIXED: A unit composed of the sum of multiple single units. Examples: foot+inch, 0044 * hour+minute+second, degree+arcminute+arcsecond. 0045 * 0046 * The complexity determines which operations are available. For example, you cannot set the power 0047 * or SI prefix of a compound unit. 0048 * 0049 * @draft ICU 67 0050 */ 0051 enum UMeasureUnitComplexity { 0052 /** 0053 * A single unit, like kilojoule. 0054 * 0055 * @draft ICU 67 0056 */ 0057 UMEASURE_UNIT_SINGLE, 0058 0059 /** 0060 * A compound unit, like meter-per-second. 0061 * 0062 * @draft ICU 67 0063 */ 0064 UMEASURE_UNIT_COMPOUND, 0065 0066 /** 0067 * A mixed unit, like hour+minute. 0068 * 0069 * @draft ICU 67 0070 */ 0071 UMEASURE_UNIT_MIXED 0072 }; 0073 0074 /** 0075 * Enumeration for SI prefixes, such as "kilo". 0076 * 0077 * @draft ICU 67 0078 */ 0079 typedef enum UMeasureSIPrefix { 0080 0081 /** 0082 * SI prefix: yotta, 10^24. 0083 * 0084 * @draft ICU 67 0085 */ 0086 UMEASURE_SI_PREFIX_YOTTA = 24, 0087 0088 /** 0089 * SI prefix: zetta, 10^21. 0090 * 0091 * @draft ICU 67 0092 */ 0093 UMEASURE_SI_PREFIX_ZETTA = 21, 0094 0095 /** 0096 * SI prefix: exa, 10^18. 0097 * 0098 * @draft ICU 67 0099 */ 0100 UMEASURE_SI_PREFIX_EXA = 18, 0101 0102 /** 0103 * SI prefix: peta, 10^15. 0104 * 0105 * @draft ICU 67 0106 */ 0107 UMEASURE_SI_PREFIX_PETA = 15, 0108 0109 /** 0110 * SI prefix: tera, 10^12. 0111 * 0112 * @draft ICU 67 0113 */ 0114 UMEASURE_SI_PREFIX_TERA = 12, 0115 0116 /** 0117 * SI prefix: giga, 10^9. 0118 * 0119 * @draft ICU 67 0120 */ 0121 UMEASURE_SI_PREFIX_GIGA = 9, 0122 0123 /** 0124 * SI prefix: mega, 10^6. 0125 * 0126 * @draft ICU 67 0127 */ 0128 UMEASURE_SI_PREFIX_MEGA = 6, 0129 0130 /** 0131 * SI prefix: kilo, 10^3. 0132 * 0133 * @draft ICU 67 0134 */ 0135 UMEASURE_SI_PREFIX_KILO = 3, 0136 0137 /** 0138 * SI prefix: hecto, 10^2. 0139 * 0140 * @draft ICU 67 0141 */ 0142 UMEASURE_SI_PREFIX_HECTO = 2, 0143 0144 /** 0145 * SI prefix: deka, 10^1. 0146 * 0147 * @draft ICU 67 0148 */ 0149 UMEASURE_SI_PREFIX_DEKA = 1, 0150 0151 /** 0152 * The absence of an SI prefix. 0153 * 0154 * @draft ICU 67 0155 */ 0156 UMEASURE_SI_PREFIX_ONE = 0, 0157 0158 /** 0159 * SI prefix: deci, 10^-1. 0160 * 0161 * @draft ICU 67 0162 */ 0163 UMEASURE_SI_PREFIX_DECI = -1, 0164 0165 /** 0166 * SI prefix: centi, 10^-2. 0167 * 0168 * @draft ICU 67 0169 */ 0170 UMEASURE_SI_PREFIX_CENTI = -2, 0171 0172 /** 0173 * SI prefix: milli, 10^-3. 0174 * 0175 * @draft ICU 67 0176 */ 0177 UMEASURE_SI_PREFIX_MILLI = -3, 0178 0179 /** 0180 * SI prefix: micro, 10^-6. 0181 * 0182 * @draft ICU 67 0183 */ 0184 UMEASURE_SI_PREFIX_MICRO = -6, 0185 0186 /** 0187 * SI prefix: nano, 10^-9. 0188 * 0189 * @draft ICU 67 0190 */ 0191 UMEASURE_SI_PREFIX_NANO = -9, 0192 0193 /** 0194 * SI prefix: pico, 10^-12. 0195 * 0196 * @draft ICU 67 0197 */ 0198 UMEASURE_SI_PREFIX_PICO = -12, 0199 0200 /** 0201 * SI prefix: femto, 10^-15. 0202 * 0203 * @draft ICU 67 0204 */ 0205 UMEASURE_SI_PREFIX_FEMTO = -15, 0206 0207 /** 0208 * SI prefix: atto, 10^-18. 0209 * 0210 * @draft ICU 67 0211 */ 0212 UMEASURE_SI_PREFIX_ATTO = -18, 0213 0214 /** 0215 * SI prefix: zepto, 10^-21. 0216 * 0217 * @draft ICU 67 0218 */ 0219 UMEASURE_SI_PREFIX_ZEPTO = -21, 0220 0221 /** 0222 * SI prefix: yocto, 10^-24. 0223 * 0224 * @draft ICU 67 0225 */ 0226 UMEASURE_SI_PREFIX_YOCTO = -24 0227 } UMeasureSIPrefix; 0228 #endif // U_HIDE_DRAFT_API 0229 0230 /** 0231 * A unit such as length, mass, volume, currency, etc. A unit is 0232 * coupled with a numeric amount to produce a Measure. 0233 * 0234 * @author Alan Liu 0235 * @stable ICU 3.0 0236 */ 0237 class U_I18N_API MeasureUnit: public UObject { 0238 public: 0239 0240 /** 0241 * Default constructor. 0242 * Populates the instance with the base dimensionless unit. 0243 * @stable ICU 3.0 0244 */ 0245 MeasureUnit(); 0246 0247 /** 0248 * Copy constructor. 0249 * @stable ICU 3.0 0250 */ 0251 MeasureUnit(const MeasureUnit &other); 0252 0253 #ifndef U_HIDE_DRAFT_API 0254 /** 0255 * Move constructor. 0256 * @draft ICU 67 0257 */ 0258 MeasureUnit(MeasureUnit &&other) noexcept; 0259 0260 /** 0261 * Construct a MeasureUnit from a CLDR Unit Identifier, defined in UTS 35. 0262 * Validates and canonicalizes the identifier. 0263 * 0264 * <pre> 0265 * MeasureUnit example = MeasureUnit::forIdentifier("furlong-per-nanosecond") 0266 * </pre> 0267 * 0268 * @param identifier The CLDR Unit Identifier 0269 * @param status Set if the identifier is invalid. 0270 * @draft ICU 67 0271 */ 0272 static MeasureUnit forIdentifier(StringPiece identifier, UErrorCode& status); 0273 #endif // U_HIDE_DRAFT_API 0274 0275 /** 0276 * Copy assignment operator. 0277 * @stable ICU 3.0 0278 */ 0279 MeasureUnit &operator=(const MeasureUnit &other); 0280 0281 #ifndef U_HIDE_DRAFT_API 0282 /** 0283 * Move assignment operator. 0284 * @draft ICU 67 0285 */ 0286 MeasureUnit &operator=(MeasureUnit &&other) noexcept; 0287 #endif // U_HIDE_DRAFT_API 0288 0289 /** 0290 * Returns a polymorphic clone of this object. The result will 0291 * have the same class as returned by getDynamicClassID(). 0292 * @stable ICU 3.0 0293 */ 0294 virtual MeasureUnit* clone() const; 0295 0296 /** 0297 * Destructor 0298 * @stable ICU 3.0 0299 */ 0300 virtual ~MeasureUnit(); 0301 0302 /** 0303 * Equality operator. Return true if this object is equal 0304 * to the given object. 0305 * @stable ICU 3.0 0306 */ 0307 virtual UBool operator==(const UObject& other) const; 0308 0309 /** 0310 * Inequality operator. Return true if this object is not equal 0311 * to the given object. 0312 * @stable ICU 53 0313 */ 0314 UBool operator!=(const UObject& other) const { 0315 return !(*this == other); 0316 } 0317 0318 /** 0319 * Get the type. 0320 * 0321 * If the unit does not have a type, the empty string is returned. 0322 * 0323 * @stable ICU 53 0324 */ 0325 const char *getType() const; 0326 0327 /** 0328 * Get the sub type. 0329 * 0330 * If the unit does not have a subtype, the empty string is returned. 0331 * 0332 * @stable ICU 53 0333 */ 0334 const char *getSubtype() const; 0335 0336 #ifndef U_HIDE_DRAFT_API 0337 /** 0338 * Get the CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35. 0339 * 0340 * @return The string form of this unit, owned by this MeasureUnit. 0341 * @draft ICU 67 0342 */ 0343 const char* getIdentifier() const; 0344 0345 /** 0346 * Compute the complexity of the unit. See UMeasureUnitComplexity for more information. 0347 * 0348 * @param status Set if an error occurs. 0349 * @return The unit complexity. 0350 * @draft ICU 67 0351 */ 0352 UMeasureUnitComplexity getComplexity(UErrorCode& status) const; 0353 0354 /** 0355 * Creates a MeasureUnit which is this SINGLE unit augmented with the specified SI prefix. 0356 * For example, UMEASURE_SI_PREFIX_KILO for "kilo". 0357 * 0358 * There is sufficient locale data to format all standard SI prefixes. 0359 * 0360 * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will 0361 * occur. For more information, see UMeasureUnitComplexity. 0362 * 0363 * @param prefix The SI prefix, from UMeasureSIPrefix. 0364 * @param status Set if this is not a SINGLE unit or if another error occurs. 0365 * @return A new SINGLE unit. 0366 * @draft ICU 67 0367 */ 0368 MeasureUnit withSIPrefix(UMeasureSIPrefix prefix, UErrorCode& status) const; 0369 0370 /** 0371 * Gets the current SI prefix of this SINGLE unit. For example, if the unit has the SI prefix 0372 * "kilo", then UMEASURE_SI_PREFIX_KILO is returned. 0373 * 0374 * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will 0375 * occur. For more information, see UMeasureUnitComplexity. 0376 * 0377 * @param status Set if this is not a SINGLE unit or if another error occurs. 0378 * @return The SI prefix of this SINGLE unit, from UMeasureSIPrefix. 0379 * @draft ICU 67 0380 */ 0381 UMeasureSIPrefix getSIPrefix(UErrorCode& status) const; 0382 0383 /** 0384 * Creates a MeasureUnit which is this SINGLE unit augmented with the specified dimensionality 0385 * (power). For example, if dimensionality is 2, the unit will be squared. 0386 * 0387 * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will 0388 * occur. For more information, see UMeasureUnitComplexity. 0389 * 0390 * For the base dimensionless unit, withDimensionality does nothing. 0391 * 0392 * @param dimensionality The dimensionality (power). 0393 * @param status Set if this is not a SINGLE unit or if another error occurs. 0394 * @return A new SINGLE unit. 0395 * @draft ICU 67 0396 */ 0397 MeasureUnit withDimensionality(int32_t dimensionality, UErrorCode& status) const; 0398 0399 /** 0400 * Gets the dimensionality (power) of this MeasureUnit. For example, if the unit is square, 0401 * then 2 is returned. 0402 * 0403 * NOTE: Only works on SINGLE units. If this is a COMPOUND or MIXED unit, an error will 0404 * occur. For more information, see UMeasureUnitComplexity. 0405 * 0406 * For the base dimensionless unit, getDimensionality returns 0. 0407 * 0408 * @param status Set if this is not a SINGLE unit or if another error occurs. 0409 * @return The dimensionality (power) of this simple unit. 0410 * @draft ICU 67 0411 */ 0412 int32_t getDimensionality(UErrorCode& status) const; 0413 0414 /** 0415 * Gets the reciprocal of this MeasureUnit, with the numerator and denominator flipped. 0416 * 0417 * For example, if the receiver is "meter-per-second", the unit "second-per-meter" is returned. 0418 * 0419 * NOTE: Only works on SINGLE and COMPOUND units. If this is a MIXED unit, an error will 0420 * occur. For more information, see UMeasureUnitComplexity. 0421 * 0422 * @param status Set if this is a MIXED unit or if another error occurs. 0423 * @return The reciprocal of the target unit. 0424 * @draft ICU 67 0425 */ 0426 MeasureUnit reciprocal(UErrorCode& status) const; 0427 0428 /** 0429 * Gets the product of this unit with another unit. This is a way to build units from 0430 * constituent parts. 0431 * 0432 * The numerator and denominator are preserved through this operation. 0433 * 0434 * For example, if the receiver is "kilowatt" and the argument is "hour-per-day", then the 0435 * unit "kilowatt-hour-per-day" is returned. 0436 * 0437 * NOTE: Only works on SINGLE and COMPOUND units. If either unit (receivee and argument) is a 0438 * MIXED unit, an error will occur. For more information, see UMeasureUnitComplexity. 0439 * 0440 * @param other The MeasureUnit to multiply with the target. 0441 * @param status Set if this or other is a MIXED unit or if another error occurs. 0442 * @return The product of the target unit with the provided unit. 0443 * @draft ICU 67 0444 */ 0445 MeasureUnit product(const MeasureUnit& other, UErrorCode& status) const; 0446 #endif // U_HIDE_DRAFT_API 0447 0448 #ifndef U_HIDE_INTERNAL_API 0449 /** 0450 * Gets the list of SINGLE units contained within a MIXED of COMPOUND unit. 0451 * 0452 * Examples: 0453 * - Given "meter-kilogram-per-second", three units will be returned: "meter", 0454 * "kilogram", and "per-second". 0455 * - Given "hour+minute+second", three units will be returned: "hour", "minute", 0456 * and "second". 0457 * 0458 * If this is a SINGLE unit, an array of length 1 will be returned. 0459 * 0460 * TODO(ICU-21021): Finalize this API and propose it as draft. 0461 * 0462 * @param outCount The number of elements in the return array. 0463 * @param status Set if an error occurs. 0464 * @return An array of single units, owned by the caller. 0465 * @internal ICU 67 Technical Preview 0466 */ 0467 LocalArray<MeasureUnit> splitToSingleUnits(int32_t& outCount, UErrorCode& status) const; 0468 #endif // U_HIDE_INTERNAL_API 0469 0470 /** 0471 * getAvailable gets all of the available units. 0472 * If there are too many units to fit into destCapacity then the 0473 * error code is set to U_BUFFER_OVERFLOW_ERROR. 0474 * 0475 * @param destArray destination buffer. 0476 * @param destCapacity number of MeasureUnit instances available at dest. 0477 * @param errorCode ICU error code. 0478 * @return number of available units. 0479 * @stable ICU 53 0480 */ 0481 static int32_t getAvailable( 0482 MeasureUnit *destArray, 0483 int32_t destCapacity, 0484 UErrorCode &errorCode); 0485 0486 /** 0487 * getAvailable gets all of the available units for a specific type. 0488 * If there are too many units to fit into destCapacity then the 0489 * error code is set to U_BUFFER_OVERFLOW_ERROR. 0490 * 0491 * @param type the type 0492 * @param destArray destination buffer. 0493 * @param destCapacity number of MeasureUnit instances available at dest. 0494 * @param errorCode ICU error code. 0495 * @return number of available units for type. 0496 * @stable ICU 53 0497 */ 0498 static int32_t getAvailable( 0499 const char *type, 0500 MeasureUnit *destArray, 0501 int32_t destCapacity, 0502 UErrorCode &errorCode); 0503 0504 /** 0505 * getAvailableTypes gets all of the available types. Caller owns the 0506 * returned StringEnumeration and must delete it when finished using it. 0507 * 0508 * @param errorCode ICU error code. 0509 * @return the types. 0510 * @stable ICU 53 0511 */ 0512 static StringEnumeration* getAvailableTypes(UErrorCode &errorCode); 0513 0514 /** 0515 * Return the class ID for this class. This is useful only for comparing to 0516 * a return value from getDynamicClassID(). For example: 0517 * <pre> 0518 * . Base* polymorphic_pointer = createPolymorphicObject(); 0519 * . if (polymorphic_pointer->getDynamicClassID() == 0520 * . Derived::getStaticClassID()) ... 0521 * </pre> 0522 * @return The class ID for all objects of this class. 0523 * @stable ICU 53 0524 */ 0525 static UClassID U_EXPORT2 getStaticClassID(void); 0526 0527 /** 0528 * Returns a unique class ID POLYMORPHICALLY. Pure virtual override. This 0529 * method is to implement a simple version of RTTI, since not all C++ 0530 * compilers support genuine RTTI. Polymorphic operator==() and clone() 0531 * methods call this method. 0532 * 0533 * @return The class ID for this object. All objects of a 0534 * given class have the same class ID. Objects of 0535 * other classes have different class IDs. 0536 * @stable ICU 53 0537 */ 0538 virtual UClassID getDynamicClassID(void) const; 0539 0540 #ifndef U_HIDE_INTERNAL_API 0541 /** 0542 * ICU use only. 0543 * Returns associated array index for this measure unit. Only valid for 0544 * non-currency measure units. 0545 * @internal 0546 */ 0547 int32_t getIndex() const; 0548 0549 /** 0550 * ICU use only. 0551 * Returns maximum value from getIndex plus 1. 0552 * @internal 0553 */ 0554 static int32_t getIndexCount(); 0555 0556 /** 0557 * ICU use only. 0558 * @return the unit.getIndex() of the unit which has this unit.getType() and unit.getSubtype(), 0559 * or a negative value if there is no such unit 0560 * @internal 0561 */ 0562 static int32_t internalGetIndexForTypeAndSubtype(const char *type, const char *subtype); 0563 0564 /** 0565 * ICU use only. 0566 * @internal 0567 */ 0568 static MeasureUnit resolveUnitPerUnit( 0569 const MeasureUnit &unit, const MeasureUnit &perUnit, bool* isResolved); 0570 #endif /* U_HIDE_INTERNAL_API */ 0571 0572 // All code between the "Start generated createXXX methods" comment and 0573 // the "End generated createXXX methods" comment is auto generated code 0574 // and must not be edited manually. For instructions on how to correctly 0575 // update this code, refer to: 0576 // http://site.icu-project.org/design/formatting/measureformat/updating-measure-unit 0577 // 0578 // Start generated createXXX methods 0579 0580 /** 0581 * Returns by pointer, unit of acceleration: g-force. 0582 * Caller owns returned value and must free it. 0583 * Also see {@link #getGForce()}. 0584 * @param status ICU error code. 0585 * @stable ICU 53 0586 */ 0587 static MeasureUnit *createGForce(UErrorCode &status); 0588 0589 /** 0590 * Returns by value, unit of acceleration: g-force. 0591 * Also see {@link #createGForce()}. 0592 * @stable ICU 64 0593 */ 0594 static MeasureUnit getGForce(); 0595 0596 /** 0597 * Returns by pointer, unit of acceleration: meter-per-square-second. 0598 * Caller owns returned value and must free it. 0599 * Also see {@link #getMeterPerSecondSquared()}. 0600 * @param status ICU error code. 0601 * @stable ICU 54 0602 */ 0603 static MeasureUnit *createMeterPerSecondSquared(UErrorCode &status); 0604 0605 /** 0606 * Returns by value, unit of acceleration: meter-per-square-second. 0607 * Also see {@link #createMeterPerSecondSquared()}. 0608 * @stable ICU 64 0609 */ 0610 static MeasureUnit getMeterPerSecondSquared(); 0611 0612 /** 0613 * Returns by pointer, unit of angle: arc-minute. 0614 * Caller owns returned value and must free it. 0615 * Also see {@link #getArcMinute()}. 0616 * @param status ICU error code. 0617 * @stable ICU 53 0618 */ 0619 static MeasureUnit *createArcMinute(UErrorCode &status); 0620 0621 /** 0622 * Returns by value, unit of angle: arc-minute. 0623 * Also see {@link #createArcMinute()}. 0624 * @stable ICU 64 0625 */ 0626 static MeasureUnit getArcMinute(); 0627 0628 /** 0629 * Returns by pointer, unit of angle: arc-second. 0630 * Caller owns returned value and must free it. 0631 * Also see {@link #getArcSecond()}. 0632 * @param status ICU error code. 0633 * @stable ICU 53 0634 */ 0635 static MeasureUnit *createArcSecond(UErrorCode &status); 0636 0637 /** 0638 * Returns by value, unit of angle: arc-second. 0639 * Also see {@link #createArcSecond()}. 0640 * @stable ICU 64 0641 */ 0642 static MeasureUnit getArcSecond(); 0643 0644 /** 0645 * Returns by pointer, unit of angle: degree. 0646 * Caller owns returned value and must free it. 0647 * Also see {@link #getDegree()}. 0648 * @param status ICU error code. 0649 * @stable ICU 53 0650 */ 0651 static MeasureUnit *createDegree(UErrorCode &status); 0652 0653 /** 0654 * Returns by value, unit of angle: degree. 0655 * Also see {@link #createDegree()}. 0656 * @stable ICU 64 0657 */ 0658 static MeasureUnit getDegree(); 0659 0660 /** 0661 * Returns by pointer, unit of angle: radian. 0662 * Caller owns returned value and must free it. 0663 * Also see {@link #getRadian()}. 0664 * @param status ICU error code. 0665 * @stable ICU 54 0666 */ 0667 static MeasureUnit *createRadian(UErrorCode &status); 0668 0669 /** 0670 * Returns by value, unit of angle: radian. 0671 * Also see {@link #createRadian()}. 0672 * @stable ICU 64 0673 */ 0674 static MeasureUnit getRadian(); 0675 0676 /** 0677 * Returns by pointer, unit of angle: revolution. 0678 * Caller owns returned value and must free it. 0679 * Also see {@link #getRevolutionAngle()}. 0680 * @param status ICU error code. 0681 * @stable ICU 56 0682 */ 0683 static MeasureUnit *createRevolutionAngle(UErrorCode &status); 0684 0685 /** 0686 * Returns by value, unit of angle: revolution. 0687 * Also see {@link #createRevolutionAngle()}. 0688 * @stable ICU 64 0689 */ 0690 static MeasureUnit getRevolutionAngle(); 0691 0692 /** 0693 * Returns by pointer, unit of area: acre. 0694 * Caller owns returned value and must free it. 0695 * Also see {@link #getAcre()}. 0696 * @param status ICU error code. 0697 * @stable ICU 53 0698 */ 0699 static MeasureUnit *createAcre(UErrorCode &status); 0700 0701 /** 0702 * Returns by value, unit of area: acre. 0703 * Also see {@link #createAcre()}. 0704 * @stable ICU 64 0705 */ 0706 static MeasureUnit getAcre(); 0707 0708 /** 0709 * Returns by pointer, unit of area: dunam. 0710 * Caller owns returned value and must free it. 0711 * Also see {@link #getDunam()}. 0712 * @param status ICU error code. 0713 * @stable ICU 64 0714 */ 0715 static MeasureUnit *createDunam(UErrorCode &status); 0716 0717 /** 0718 * Returns by value, unit of area: dunam. 0719 * Also see {@link #createDunam()}. 0720 * @stable ICU 64 0721 */ 0722 static MeasureUnit getDunam(); 0723 0724 /** 0725 * Returns by pointer, unit of area: hectare. 0726 * Caller owns returned value and must free it. 0727 * Also see {@link #getHectare()}. 0728 * @param status ICU error code. 0729 * @stable ICU 53 0730 */ 0731 static MeasureUnit *createHectare(UErrorCode &status); 0732 0733 /** 0734 * Returns by value, unit of area: hectare. 0735 * Also see {@link #createHectare()}. 0736 * @stable ICU 64 0737 */ 0738 static MeasureUnit getHectare(); 0739 0740 /** 0741 * Returns by pointer, unit of area: square-centimeter. 0742 * Caller owns returned value and must free it. 0743 * Also see {@link #getSquareCentimeter()}. 0744 * @param status ICU error code. 0745 * @stable ICU 54 0746 */ 0747 static MeasureUnit *createSquareCentimeter(UErrorCode &status); 0748 0749 /** 0750 * Returns by value, unit of area: square-centimeter. 0751 * Also see {@link #createSquareCentimeter()}. 0752 * @stable ICU 64 0753 */ 0754 static MeasureUnit getSquareCentimeter(); 0755 0756 /** 0757 * Returns by pointer, unit of area: square-foot. 0758 * Caller owns returned value and must free it. 0759 * Also see {@link #getSquareFoot()}. 0760 * @param status ICU error code. 0761 * @stable ICU 53 0762 */ 0763 static MeasureUnit *createSquareFoot(UErrorCode &status); 0764 0765 /** 0766 * Returns by value, unit of area: square-foot. 0767 * Also see {@link #createSquareFoot()}. 0768 * @stable ICU 64 0769 */ 0770 static MeasureUnit getSquareFoot(); 0771 0772 /** 0773 * Returns by pointer, unit of area: square-inch. 0774 * Caller owns returned value and must free it. 0775 * Also see {@link #getSquareInch()}. 0776 * @param status ICU error code. 0777 * @stable ICU 54 0778 */ 0779 static MeasureUnit *createSquareInch(UErrorCode &status); 0780 0781 /** 0782 * Returns by value, unit of area: square-inch. 0783 * Also see {@link #createSquareInch()}. 0784 * @stable ICU 64 0785 */ 0786 static MeasureUnit getSquareInch(); 0787 0788 /** 0789 * Returns by pointer, unit of area: square-kilometer. 0790 * Caller owns returned value and must free it. 0791 * Also see {@link #getSquareKilometer()}. 0792 * @param status ICU error code. 0793 * @stable ICU 53 0794 */ 0795 static MeasureUnit *createSquareKilometer(UErrorCode &status); 0796 0797 /** 0798 * Returns by value, unit of area: square-kilometer. 0799 * Also see {@link #createSquareKilometer()}. 0800 * @stable ICU 64 0801 */ 0802 static MeasureUnit getSquareKilometer(); 0803 0804 /** 0805 * Returns by pointer, unit of area: square-meter. 0806 * Caller owns returned value and must free it. 0807 * Also see {@link #getSquareMeter()}. 0808 * @param status ICU error code. 0809 * @stable ICU 53 0810 */ 0811 static MeasureUnit *createSquareMeter(UErrorCode &status); 0812 0813 /** 0814 * Returns by value, unit of area: square-meter. 0815 * Also see {@link #createSquareMeter()}. 0816 * @stable ICU 64 0817 */ 0818 static MeasureUnit getSquareMeter(); 0819 0820 /** 0821 * Returns by pointer, unit of area: square-mile. 0822 * Caller owns returned value and must free it. 0823 * Also see {@link #getSquareMile()}. 0824 * @param status ICU error code. 0825 * @stable ICU 53 0826 */ 0827 static MeasureUnit *createSquareMile(UErrorCode &status); 0828 0829 /** 0830 * Returns by value, unit of area: square-mile. 0831 * Also see {@link #createSquareMile()}. 0832 * @stable ICU 64 0833 */ 0834 static MeasureUnit getSquareMile(); 0835 0836 /** 0837 * Returns by pointer, unit of area: square-yard. 0838 * Caller owns returned value and must free it. 0839 * Also see {@link #getSquareYard()}. 0840 * @param status ICU error code. 0841 * @stable ICU 54 0842 */ 0843 static MeasureUnit *createSquareYard(UErrorCode &status); 0844 0845 /** 0846 * Returns by value, unit of area: square-yard. 0847 * Also see {@link #createSquareYard()}. 0848 * @stable ICU 64 0849 */ 0850 static MeasureUnit getSquareYard(); 0851 0852 /** 0853 * Returns by pointer, unit of concentr: karat. 0854 * Caller owns returned value and must free it. 0855 * Also see {@link #getKarat()}. 0856 * @param status ICU error code. 0857 * @stable ICU 54 0858 */ 0859 static MeasureUnit *createKarat(UErrorCode &status); 0860 0861 /** 0862 * Returns by value, unit of concentr: karat. 0863 * Also see {@link #createKarat()}. 0864 * @stable ICU 64 0865 */ 0866 static MeasureUnit getKarat(); 0867 0868 /** 0869 * Returns by pointer, unit of concentr: milligram-per-deciliter. 0870 * Caller owns returned value and must free it. 0871 * Also see {@link #getMilligramPerDeciliter()}. 0872 * @param status ICU error code. 0873 * @stable ICU 57 0874 */ 0875 static MeasureUnit *createMilligramPerDeciliter(UErrorCode &status); 0876 0877 /** 0878 * Returns by value, unit of concentr: milligram-per-deciliter. 0879 * Also see {@link #createMilligramPerDeciliter()}. 0880 * @stable ICU 64 0881 */ 0882 static MeasureUnit getMilligramPerDeciliter(); 0883 0884 /** 0885 * Returns by pointer, unit of concentr: millimole-per-liter. 0886 * Caller owns returned value and must free it. 0887 * Also see {@link #getMillimolePerLiter()}. 0888 * @param status ICU error code. 0889 * @stable ICU 57 0890 */ 0891 static MeasureUnit *createMillimolePerLiter(UErrorCode &status); 0892 0893 /** 0894 * Returns by value, unit of concentr: millimole-per-liter. 0895 * Also see {@link #createMillimolePerLiter()}. 0896 * @stable ICU 64 0897 */ 0898 static MeasureUnit getMillimolePerLiter(); 0899 0900 /** 0901 * Returns by pointer, unit of concentr: mole. 0902 * Caller owns returned value and must free it. 0903 * Also see {@link #getMole()}. 0904 * @param status ICU error code. 0905 * @stable ICU 64 0906 */ 0907 static MeasureUnit *createMole(UErrorCode &status); 0908 0909 /** 0910 * Returns by value, unit of concentr: mole. 0911 * Also see {@link #createMole()}. 0912 * @stable ICU 64 0913 */ 0914 static MeasureUnit getMole(); 0915 0916 /** 0917 * Returns by pointer, unit of concentr: permillion. 0918 * Caller owns returned value and must free it. 0919 * Also see {@link #getPartPerMillion()}. 0920 * @param status ICU error code. 0921 * @stable ICU 57 0922 */ 0923 static MeasureUnit *createPartPerMillion(UErrorCode &status); 0924 0925 /** 0926 * Returns by value, unit of concentr: permillion. 0927 * Also see {@link #createPartPerMillion()}. 0928 * @stable ICU 64 0929 */ 0930 static MeasureUnit getPartPerMillion(); 0931 0932 /** 0933 * Returns by pointer, unit of concentr: percent. 0934 * Caller owns returned value and must free it. 0935 * Also see {@link #getPercent()}. 0936 * @param status ICU error code. 0937 * @stable ICU 63 0938 */ 0939 static MeasureUnit *createPercent(UErrorCode &status); 0940 0941 /** 0942 * Returns by value, unit of concentr: percent. 0943 * Also see {@link #createPercent()}. 0944 * @stable ICU 64 0945 */ 0946 static MeasureUnit getPercent(); 0947 0948 /** 0949 * Returns by pointer, unit of concentr: permille. 0950 * Caller owns returned value and must free it. 0951 * Also see {@link #getPermille()}. 0952 * @param status ICU error code. 0953 * @stable ICU 63 0954 */ 0955 static MeasureUnit *createPermille(UErrorCode &status); 0956 0957 /** 0958 * Returns by value, unit of concentr: permille. 0959 * Also see {@link #createPermille()}. 0960 * @stable ICU 64 0961 */ 0962 static MeasureUnit getPermille(); 0963 0964 /** 0965 * Returns by pointer, unit of concentr: permyriad. 0966 * Caller owns returned value and must free it. 0967 * Also see {@link #getPermyriad()}. 0968 * @param status ICU error code. 0969 * @stable ICU 64 0970 */ 0971 static MeasureUnit *createPermyriad(UErrorCode &status); 0972 0973 /** 0974 * Returns by value, unit of concentr: permyriad. 0975 * Also see {@link #createPermyriad()}. 0976 * @stable ICU 64 0977 */ 0978 static MeasureUnit getPermyriad(); 0979 0980 /** 0981 * Returns by pointer, unit of consumption: liter-per-100-kilometer. 0982 * Caller owns returned value and must free it. 0983 * Also see {@link #getLiterPer100Kilometers()}. 0984 * @param status ICU error code. 0985 * @stable ICU 56 0986 */ 0987 static MeasureUnit *createLiterPer100Kilometers(UErrorCode &status); 0988 0989 /** 0990 * Returns by value, unit of consumption: liter-per-100-kilometer. 0991 * Also see {@link #createLiterPer100Kilometers()}. 0992 * @stable ICU 64 0993 */ 0994 static MeasureUnit getLiterPer100Kilometers(); 0995 0996 /** 0997 * Returns by pointer, unit of consumption: liter-per-kilometer. 0998 * Caller owns returned value and must free it. 0999 * Also see {@link #getLiterPerKilometer()}. 1000 * @param status ICU error code. 1001 * @stable ICU 54 1002 */ 1003 static MeasureUnit *createLiterPerKilometer(UErrorCode &status); 1004 1005 /** 1006 * Returns by value, unit of consumption: liter-per-kilometer. 1007 * Also see {@link #createLiterPerKilometer()}. 1008 * @stable ICU 64 1009 */ 1010 static MeasureUnit getLiterPerKilometer(); 1011 1012 /** 1013 * Returns by pointer, unit of consumption: mile-per-gallon. 1014 * Caller owns returned value and must free it. 1015 * Also see {@link #getMilePerGallon()}. 1016 * @param status ICU error code. 1017 * @stable ICU 54 1018 */ 1019 static MeasureUnit *createMilePerGallon(UErrorCode &status); 1020 1021 /** 1022 * Returns by value, unit of consumption: mile-per-gallon. 1023 * Also see {@link #createMilePerGallon()}. 1024 * @stable ICU 64 1025 */ 1026 static MeasureUnit getMilePerGallon(); 1027 1028 /** 1029 * Returns by pointer, unit of consumption: mile-per-gallon-imperial. 1030 * Caller owns returned value and must free it. 1031 * Also see {@link #getMilePerGallonImperial()}. 1032 * @param status ICU error code. 1033 * @stable ICU 57 1034 */ 1035 static MeasureUnit *createMilePerGallonImperial(UErrorCode &status); 1036 1037 /** 1038 * Returns by value, unit of consumption: mile-per-gallon-imperial. 1039 * Also see {@link #createMilePerGallonImperial()}. 1040 * @stable ICU 64 1041 */ 1042 static MeasureUnit getMilePerGallonImperial(); 1043 1044 /** 1045 * Returns by pointer, unit of digital: bit. 1046 * Caller owns returned value and must free it. 1047 * Also see {@link #getBit()}. 1048 * @param status ICU error code. 1049 * @stable ICU 54 1050 */ 1051 static MeasureUnit *createBit(UErrorCode &status); 1052 1053 /** 1054 * Returns by value, unit of digital: bit. 1055 * Also see {@link #createBit()}. 1056 * @stable ICU 64 1057 */ 1058 static MeasureUnit getBit(); 1059 1060 /** 1061 * Returns by pointer, unit of digital: byte. 1062 * Caller owns returned value and must free it. 1063 * Also see {@link #getByte()}. 1064 * @param status ICU error code. 1065 * @stable ICU 54 1066 */ 1067 static MeasureUnit *createByte(UErrorCode &status); 1068 1069 /** 1070 * Returns by value, unit of digital: byte. 1071 * Also see {@link #createByte()}. 1072 * @stable ICU 64 1073 */ 1074 static MeasureUnit getByte(); 1075 1076 /** 1077 * Returns by pointer, unit of digital: gigabit. 1078 * Caller owns returned value and must free it. 1079 * Also see {@link #getGigabit()}. 1080 * @param status ICU error code. 1081 * @stable ICU 54 1082 */ 1083 static MeasureUnit *createGigabit(UErrorCode &status); 1084 1085 /** 1086 * Returns by value, unit of digital: gigabit. 1087 * Also see {@link #createGigabit()}. 1088 * @stable ICU 64 1089 */ 1090 static MeasureUnit getGigabit(); 1091 1092 /** 1093 * Returns by pointer, unit of digital: gigabyte. 1094 * Caller owns returned value and must free it. 1095 * Also see {@link #getGigabyte()}. 1096 * @param status ICU error code. 1097 * @stable ICU 54 1098 */ 1099 static MeasureUnit *createGigabyte(UErrorCode &status); 1100 1101 /** 1102 * Returns by value, unit of digital: gigabyte. 1103 * Also see {@link #createGigabyte()}. 1104 * @stable ICU 64 1105 */ 1106 static MeasureUnit getGigabyte(); 1107 1108 /** 1109 * Returns by pointer, unit of digital: kilobit. 1110 * Caller owns returned value and must free it. 1111 * Also see {@link #getKilobit()}. 1112 * @param status ICU error code. 1113 * @stable ICU 54 1114 */ 1115 static MeasureUnit *createKilobit(UErrorCode &status); 1116 1117 /** 1118 * Returns by value, unit of digital: kilobit. 1119 * Also see {@link #createKilobit()}. 1120 * @stable ICU 64 1121 */ 1122 static MeasureUnit getKilobit(); 1123 1124 /** 1125 * Returns by pointer, unit of digital: kilobyte. 1126 * Caller owns returned value and must free it. 1127 * Also see {@link #getKilobyte()}. 1128 * @param status ICU error code. 1129 * @stable ICU 54 1130 */ 1131 static MeasureUnit *createKilobyte(UErrorCode &status); 1132 1133 /** 1134 * Returns by value, unit of digital: kilobyte. 1135 * Also see {@link #createKilobyte()}. 1136 * @stable ICU 64 1137 */ 1138 static MeasureUnit getKilobyte(); 1139 1140 /** 1141 * Returns by pointer, unit of digital: megabit. 1142 * Caller owns returned value and must free it. 1143 * Also see {@link #getMegabit()}. 1144 * @param status ICU error code. 1145 * @stable ICU 54 1146 */ 1147 static MeasureUnit *createMegabit(UErrorCode &status); 1148 1149 /** 1150 * Returns by value, unit of digital: megabit. 1151 * Also see {@link #createMegabit()}. 1152 * @stable ICU 64 1153 */ 1154 static MeasureUnit getMegabit(); 1155 1156 /** 1157 * Returns by pointer, unit of digital: megabyte. 1158 * Caller owns returned value and must free it. 1159 * Also see {@link #getMegabyte()}. 1160 * @param status ICU error code. 1161 * @stable ICU 54 1162 */ 1163 static MeasureUnit *createMegabyte(UErrorCode &status); 1164 1165 /** 1166 * Returns by value, unit of digital: megabyte. 1167 * Also see {@link #createMegabyte()}. 1168 * @stable ICU 64 1169 */ 1170 static MeasureUnit getMegabyte(); 1171 1172 /** 1173 * Returns by pointer, unit of digital: petabyte. 1174 * Caller owns returned value and must free it. 1175 * Also see {@link #getPetabyte()}. 1176 * @param status ICU error code. 1177 * @stable ICU 63 1178 */ 1179 static MeasureUnit *createPetabyte(UErrorCode &status); 1180 1181 /** 1182 * Returns by value, unit of digital: petabyte. 1183 * Also see {@link #createPetabyte()}. 1184 * @stable ICU 64 1185 */ 1186 static MeasureUnit getPetabyte(); 1187 1188 /** 1189 * Returns by pointer, unit of digital: terabit. 1190 * Caller owns returned value and must free it. 1191 * Also see {@link #getTerabit()}. 1192 * @param status ICU error code. 1193 * @stable ICU 54 1194 */ 1195 static MeasureUnit *createTerabit(UErrorCode &status); 1196 1197 /** 1198 * Returns by value, unit of digital: terabit. 1199 * Also see {@link #createTerabit()}. 1200 * @stable ICU 64 1201 */ 1202 static MeasureUnit getTerabit(); 1203 1204 /** 1205 * Returns by pointer, unit of digital: terabyte. 1206 * Caller owns returned value and must free it. 1207 * Also see {@link #getTerabyte()}. 1208 * @param status ICU error code. 1209 * @stable ICU 54 1210 */ 1211 static MeasureUnit *createTerabyte(UErrorCode &status); 1212 1213 /** 1214 * Returns by value, unit of digital: terabyte. 1215 * Also see {@link #createTerabyte()}. 1216 * @stable ICU 64 1217 */ 1218 static MeasureUnit getTerabyte(); 1219 1220 /** 1221 * Returns by pointer, unit of duration: century. 1222 * Caller owns returned value and must free it. 1223 * Also see {@link #getCentury()}. 1224 * @param status ICU error code. 1225 * @stable ICU 56 1226 */ 1227 static MeasureUnit *createCentury(UErrorCode &status); 1228 1229 /** 1230 * Returns by value, unit of duration: century. 1231 * Also see {@link #createCentury()}. 1232 * @stable ICU 64 1233 */ 1234 static MeasureUnit getCentury(); 1235 1236 /** 1237 * Returns by pointer, unit of duration: day. 1238 * Caller owns returned value and must free it. 1239 * Also see {@link #getDay()}. 1240 * @param status ICU error code. 1241 * @stable ICU 53 1242 */ 1243 static MeasureUnit *createDay(UErrorCode &status); 1244 1245 /** 1246 * Returns by value, unit of duration: day. 1247 * Also see {@link #createDay()}. 1248 * @stable ICU 64 1249 */ 1250 static MeasureUnit getDay(); 1251 1252 /** 1253 * Returns by pointer, unit of duration: day-person. 1254 * Caller owns returned value and must free it. 1255 * Also see {@link #getDayPerson()}. 1256 * @param status ICU error code. 1257 * @stable ICU 64 1258 */ 1259 static MeasureUnit *createDayPerson(UErrorCode &status); 1260 1261 /** 1262 * Returns by value, unit of duration: day-person. 1263 * Also see {@link #createDayPerson()}. 1264 * @stable ICU 64 1265 */ 1266 static MeasureUnit getDayPerson(); 1267 1268 #ifndef U_HIDE_DRAFT_API 1269 /** 1270 * Returns by pointer, unit of duration: decade. 1271 * Caller owns returned value and must free it. 1272 * Also see {@link #getDecade()}. 1273 * @param status ICU error code. 1274 * @draft ICU 65 1275 */ 1276 static MeasureUnit *createDecade(UErrorCode &status); 1277 1278 /** 1279 * Returns by value, unit of duration: decade. 1280 * Also see {@link #createDecade()}. 1281 * @draft ICU 65 1282 */ 1283 static MeasureUnit getDecade(); 1284 #endif /* U_HIDE_DRAFT_API */ 1285 1286 /** 1287 * Returns by pointer, unit of duration: hour. 1288 * Caller owns returned value and must free it. 1289 * Also see {@link #getHour()}. 1290 * @param status ICU error code. 1291 * @stable ICU 53 1292 */ 1293 static MeasureUnit *createHour(UErrorCode &status); 1294 1295 /** 1296 * Returns by value, unit of duration: hour. 1297 * Also see {@link #createHour()}. 1298 * @stable ICU 64 1299 */ 1300 static MeasureUnit getHour(); 1301 1302 /** 1303 * Returns by pointer, unit of duration: microsecond. 1304 * Caller owns returned value and must free it. 1305 * Also see {@link #getMicrosecond()}. 1306 * @param status ICU error code. 1307 * @stable ICU 54 1308 */ 1309 static MeasureUnit *createMicrosecond(UErrorCode &status); 1310 1311 /** 1312 * Returns by value, unit of duration: microsecond. 1313 * Also see {@link #createMicrosecond()}. 1314 * @stable ICU 64 1315 */ 1316 static MeasureUnit getMicrosecond(); 1317 1318 /** 1319 * Returns by pointer, unit of duration: millisecond. 1320 * Caller owns returned value and must free it. 1321 * Also see {@link #getMillisecond()}. 1322 * @param status ICU error code. 1323 * @stable ICU 53 1324 */ 1325 static MeasureUnit *createMillisecond(UErrorCode &status); 1326 1327 /** 1328 * Returns by value, unit of duration: millisecond. 1329 * Also see {@link #createMillisecond()}. 1330 * @stable ICU 64 1331 */ 1332 static MeasureUnit getMillisecond(); 1333 1334 /** 1335 * Returns by pointer, unit of duration: minute. 1336 * Caller owns returned value and must free it. 1337 * Also see {@link #getMinute()}. 1338 * @param status ICU error code. 1339 * @stable ICU 53 1340 */ 1341 static MeasureUnit *createMinute(UErrorCode &status); 1342 1343 /** 1344 * Returns by value, unit of duration: minute. 1345 * Also see {@link #createMinute()}. 1346 * @stable ICU 64 1347 */ 1348 static MeasureUnit getMinute(); 1349 1350 /** 1351 * Returns by pointer, unit of duration: month. 1352 * Caller owns returned value and must free it. 1353 * Also see {@link #getMonth()}. 1354 * @param status ICU error code. 1355 * @stable ICU 53 1356 */ 1357 static MeasureUnit *createMonth(UErrorCode &status); 1358 1359 /** 1360 * Returns by value, unit of duration: month. 1361 * Also see {@link #createMonth()}. 1362 * @stable ICU 64 1363 */ 1364 static MeasureUnit getMonth(); 1365 1366 /** 1367 * Returns by pointer, unit of duration: month-person. 1368 * Caller owns returned value and must free it. 1369 * Also see {@link #getMonthPerson()}. 1370 * @param status ICU error code. 1371 * @stable ICU 64 1372 */ 1373 static MeasureUnit *createMonthPerson(UErrorCode &status); 1374 1375 /** 1376 * Returns by value, unit of duration: month-person. 1377 * Also see {@link #createMonthPerson()}. 1378 * @stable ICU 64 1379 */ 1380 static MeasureUnit getMonthPerson(); 1381 1382 /** 1383 * Returns by pointer, unit of duration: nanosecond. 1384 * Caller owns returned value and must free it. 1385 * Also see {@link #getNanosecond()}. 1386 * @param status ICU error code. 1387 * @stable ICU 54 1388 */ 1389 static MeasureUnit *createNanosecond(UErrorCode &status); 1390 1391 /** 1392 * Returns by value, unit of duration: nanosecond. 1393 * Also see {@link #createNanosecond()}. 1394 * @stable ICU 64 1395 */ 1396 static MeasureUnit getNanosecond(); 1397 1398 /** 1399 * Returns by pointer, unit of duration: second. 1400 * Caller owns returned value and must free it. 1401 * Also see {@link #getSecond()}. 1402 * @param status ICU error code. 1403 * @stable ICU 53 1404 */ 1405 static MeasureUnit *createSecond(UErrorCode &status); 1406 1407 /** 1408 * Returns by value, unit of duration: second. 1409 * Also see {@link #createSecond()}. 1410 * @stable ICU 64 1411 */ 1412 static MeasureUnit getSecond(); 1413 1414 /** 1415 * Returns by pointer, unit of duration: week. 1416 * Caller owns returned value and must free it. 1417 * Also see {@link #getWeek()}. 1418 * @param status ICU error code. 1419 * @stable ICU 53 1420 */ 1421 static MeasureUnit *createWeek(UErrorCode &status); 1422 1423 /** 1424 * Returns by value, unit of duration: week. 1425 * Also see {@link #createWeek()}. 1426 * @stable ICU 64 1427 */ 1428 static MeasureUnit getWeek(); 1429 1430 /** 1431 * Returns by pointer, unit of duration: week-person. 1432 * Caller owns returned value and must free it. 1433 * Also see {@link #getWeekPerson()}. 1434 * @param status ICU error code. 1435 * @stable ICU 64 1436 */ 1437 static MeasureUnit *createWeekPerson(UErrorCode &status); 1438 1439 /** 1440 * Returns by value, unit of duration: week-person. 1441 * Also see {@link #createWeekPerson()}. 1442 * @stable ICU 64 1443 */ 1444 static MeasureUnit getWeekPerson(); 1445 1446 /** 1447 * Returns by pointer, unit of duration: year. 1448 * Caller owns returned value and must free it. 1449 * Also see {@link #getYear()}. 1450 * @param status ICU error code. 1451 * @stable ICU 53 1452 */ 1453 static MeasureUnit *createYear(UErrorCode &status); 1454 1455 /** 1456 * Returns by value, unit of duration: year. 1457 * Also see {@link #createYear()}. 1458 * @stable ICU 64 1459 */ 1460 static MeasureUnit getYear(); 1461 1462 /** 1463 * Returns by pointer, unit of duration: year-person. 1464 * Caller owns returned value and must free it. 1465 * Also see {@link #getYearPerson()}. 1466 * @param status ICU error code. 1467 * @stable ICU 64 1468 */ 1469 static MeasureUnit *createYearPerson(UErrorCode &status); 1470 1471 /** 1472 * Returns by value, unit of duration: year-person. 1473 * Also see {@link #createYearPerson()}. 1474 * @stable ICU 64 1475 */ 1476 static MeasureUnit getYearPerson(); 1477 1478 /** 1479 * Returns by pointer, unit of electric: ampere. 1480 * Caller owns returned value and must free it. 1481 * Also see {@link #getAmpere()}. 1482 * @param status ICU error code. 1483 * @stable ICU 54 1484 */ 1485 static MeasureUnit *createAmpere(UErrorCode &status); 1486 1487 /** 1488 * Returns by value, unit of electric: ampere. 1489 * Also see {@link #createAmpere()}. 1490 * @stable ICU 64 1491 */ 1492 static MeasureUnit getAmpere(); 1493 1494 /** 1495 * Returns by pointer, unit of electric: milliampere. 1496 * Caller owns returned value and must free it. 1497 * Also see {@link #getMilliampere()}. 1498 * @param status ICU error code. 1499 * @stable ICU 54 1500 */ 1501 static MeasureUnit *createMilliampere(UErrorCode &status); 1502 1503 /** 1504 * Returns by value, unit of electric: milliampere. 1505 * Also see {@link #createMilliampere()}. 1506 * @stable ICU 64 1507 */ 1508 static MeasureUnit getMilliampere(); 1509 1510 /** 1511 * Returns by pointer, unit of electric: ohm. 1512 * Caller owns returned value and must free it. 1513 * Also see {@link #getOhm()}. 1514 * @param status ICU error code. 1515 * @stable ICU 54 1516 */ 1517 static MeasureUnit *createOhm(UErrorCode &status); 1518 1519 /** 1520 * Returns by value, unit of electric: ohm. 1521 * Also see {@link #createOhm()}. 1522 * @stable ICU 64 1523 */ 1524 static MeasureUnit getOhm(); 1525 1526 /** 1527 * Returns by pointer, unit of electric: volt. 1528 * Caller owns returned value and must free it. 1529 * Also see {@link #getVolt()}. 1530 * @param status ICU error code. 1531 * @stable ICU 54 1532 */ 1533 static MeasureUnit *createVolt(UErrorCode &status); 1534 1535 /** 1536 * Returns by value, unit of electric: volt. 1537 * Also see {@link #createVolt()}. 1538 * @stable ICU 64 1539 */ 1540 static MeasureUnit getVolt(); 1541 1542 /** 1543 * Returns by pointer, unit of energy: british-thermal-unit. 1544 * Caller owns returned value and must free it. 1545 * Also see {@link #getBritishThermalUnit()}. 1546 * @param status ICU error code. 1547 * @stable ICU 64 1548 */ 1549 static MeasureUnit *createBritishThermalUnit(UErrorCode &status); 1550 1551 /** 1552 * Returns by value, unit of energy: british-thermal-unit. 1553 * Also see {@link #createBritishThermalUnit()}. 1554 * @stable ICU 64 1555 */ 1556 static MeasureUnit getBritishThermalUnit(); 1557 1558 /** 1559 * Returns by pointer, unit of energy: calorie. 1560 * Caller owns returned value and must free it. 1561 * Also see {@link #getCalorie()}. 1562 * @param status ICU error code. 1563 * @stable ICU 54 1564 */ 1565 static MeasureUnit *createCalorie(UErrorCode &status); 1566 1567 /** 1568 * Returns by value, unit of energy: calorie. 1569 * Also see {@link #createCalorie()}. 1570 * @stable ICU 64 1571 */ 1572 static MeasureUnit getCalorie(); 1573 1574 /** 1575 * Returns by pointer, unit of energy: electronvolt. 1576 * Caller owns returned value and must free it. 1577 * Also see {@link #getElectronvolt()}. 1578 * @param status ICU error code. 1579 * @stable ICU 64 1580 */ 1581 static MeasureUnit *createElectronvolt(UErrorCode &status); 1582 1583 /** 1584 * Returns by value, unit of energy: electronvolt. 1585 * Also see {@link #createElectronvolt()}. 1586 * @stable ICU 64 1587 */ 1588 static MeasureUnit getElectronvolt(); 1589 1590 /** 1591 * Returns by pointer, unit of energy: foodcalorie. 1592 * Caller owns returned value and must free it. 1593 * Also see {@link #getFoodcalorie()}. 1594 * @param status ICU error code. 1595 * @stable ICU 54 1596 */ 1597 static MeasureUnit *createFoodcalorie(UErrorCode &status); 1598 1599 /** 1600 * Returns by value, unit of energy: foodcalorie. 1601 * Also see {@link #createFoodcalorie()}. 1602 * @stable ICU 64 1603 */ 1604 static MeasureUnit getFoodcalorie(); 1605 1606 /** 1607 * Returns by pointer, unit of energy: joule. 1608 * Caller owns returned value and must free it. 1609 * Also see {@link #getJoule()}. 1610 * @param status ICU error code. 1611 * @stable ICU 54 1612 */ 1613 static MeasureUnit *createJoule(UErrorCode &status); 1614 1615 /** 1616 * Returns by value, unit of energy: joule. 1617 * Also see {@link #createJoule()}. 1618 * @stable ICU 64 1619 */ 1620 static MeasureUnit getJoule(); 1621 1622 /** 1623 * Returns by pointer, unit of energy: kilocalorie. 1624 * Caller owns returned value and must free it. 1625 * Also see {@link #getKilocalorie()}. 1626 * @param status ICU error code. 1627 * @stable ICU 54 1628 */ 1629 static MeasureUnit *createKilocalorie(UErrorCode &status); 1630 1631 /** 1632 * Returns by value, unit of energy: kilocalorie. 1633 * Also see {@link #createKilocalorie()}. 1634 * @stable ICU 64 1635 */ 1636 static MeasureUnit getKilocalorie(); 1637 1638 /** 1639 * Returns by pointer, unit of energy: kilojoule. 1640 * Caller owns returned value and must free it. 1641 * Also see {@link #getKilojoule()}. 1642 * @param status ICU error code. 1643 * @stable ICU 54 1644 */ 1645 static MeasureUnit *createKilojoule(UErrorCode &status); 1646 1647 /** 1648 * Returns by value, unit of energy: kilojoule. 1649 * Also see {@link #createKilojoule()}. 1650 * @stable ICU 64 1651 */ 1652 static MeasureUnit getKilojoule(); 1653 1654 /** 1655 * Returns by pointer, unit of energy: kilowatt-hour. 1656 * Caller owns returned value and must free it. 1657 * Also see {@link #getKilowattHour()}. 1658 * @param status ICU error code. 1659 * @stable ICU 54 1660 */ 1661 static MeasureUnit *createKilowattHour(UErrorCode &status); 1662 1663 /** 1664 * Returns by value, unit of energy: kilowatt-hour. 1665 * Also see {@link #createKilowattHour()}. 1666 * @stable ICU 64 1667 */ 1668 static MeasureUnit getKilowattHour(); 1669 1670 #ifndef U_HIDE_DRAFT_API 1671 /** 1672 * Returns by pointer, unit of energy: therm-us. 1673 * Caller owns returned value and must free it. 1674 * Also see {@link #getThermUs()}. 1675 * @param status ICU error code. 1676 * @draft ICU 65 1677 */ 1678 static MeasureUnit *createThermUs(UErrorCode &status); 1679 1680 /** 1681 * Returns by value, unit of energy: therm-us. 1682 * Also see {@link #createThermUs()}. 1683 * @draft ICU 65 1684 */ 1685 static MeasureUnit getThermUs(); 1686 #endif /* U_HIDE_DRAFT_API */ 1687 1688 /** 1689 * Returns by pointer, unit of force: newton. 1690 * Caller owns returned value and must free it. 1691 * Also see {@link #getNewton()}. 1692 * @param status ICU error code. 1693 * @stable ICU 64 1694 */ 1695 static MeasureUnit *createNewton(UErrorCode &status); 1696 1697 /** 1698 * Returns by value, unit of force: newton. 1699 * Also see {@link #createNewton()}. 1700 * @stable ICU 64 1701 */ 1702 static MeasureUnit getNewton(); 1703 1704 /** 1705 * Returns by pointer, unit of force: pound-force. 1706 * Caller owns returned value and must free it. 1707 * Also see {@link #getPoundForce()}. 1708 * @param status ICU error code. 1709 * @stable ICU 64 1710 */ 1711 static MeasureUnit *createPoundForce(UErrorCode &status); 1712 1713 /** 1714 * Returns by value, unit of force: pound-force. 1715 * Also see {@link #createPoundForce()}. 1716 * @stable ICU 64 1717 */ 1718 static MeasureUnit getPoundForce(); 1719 1720 /** 1721 * Returns by pointer, unit of frequency: gigahertz. 1722 * Caller owns returned value and must free it. 1723 * Also see {@link #getGigahertz()}. 1724 * @param status ICU error code. 1725 * @stable ICU 54 1726 */ 1727 static MeasureUnit *createGigahertz(UErrorCode &status); 1728 1729 /** 1730 * Returns by value, unit of frequency: gigahertz. 1731 * Also see {@link #createGigahertz()}. 1732 * @stable ICU 64 1733 */ 1734 static MeasureUnit getGigahertz(); 1735 1736 /** 1737 * Returns by pointer, unit of frequency: hertz. 1738 * Caller owns returned value and must free it. 1739 * Also see {@link #getHertz()}. 1740 * @param status ICU error code. 1741 * @stable ICU 54 1742 */ 1743 static MeasureUnit *createHertz(UErrorCode &status); 1744 1745 /** 1746 * Returns by value, unit of frequency: hertz. 1747 * Also see {@link #createHertz()}. 1748 * @stable ICU 64 1749 */ 1750 static MeasureUnit getHertz(); 1751 1752 /** 1753 * Returns by pointer, unit of frequency: kilohertz. 1754 * Caller owns returned value and must free it. 1755 * Also see {@link #getKilohertz()}. 1756 * @param status ICU error code. 1757 * @stable ICU 54 1758 */ 1759 static MeasureUnit *createKilohertz(UErrorCode &status); 1760 1761 /** 1762 * Returns by value, unit of frequency: kilohertz. 1763 * Also see {@link #createKilohertz()}. 1764 * @stable ICU 64 1765 */ 1766 static MeasureUnit getKilohertz(); 1767 1768 /** 1769 * Returns by pointer, unit of frequency: megahertz. 1770 * Caller owns returned value and must free it. 1771 * Also see {@link #getMegahertz()}. 1772 * @param status ICU error code. 1773 * @stable ICU 54 1774 */ 1775 static MeasureUnit *createMegahertz(UErrorCode &status); 1776 1777 /** 1778 * Returns by value, unit of frequency: megahertz. 1779 * Also see {@link #createMegahertz()}. 1780 * @stable ICU 64 1781 */ 1782 static MeasureUnit getMegahertz(); 1783 1784 #ifndef U_HIDE_DRAFT_API 1785 /** 1786 * Returns by pointer, unit of graphics: dot-per-centimeter. 1787 * Caller owns returned value and must free it. 1788 * Also see {@link #getDotPerCentimeter()}. 1789 * @param status ICU error code. 1790 * @draft ICU 65 1791 */ 1792 static MeasureUnit *createDotPerCentimeter(UErrorCode &status); 1793 1794 /** 1795 * Returns by value, unit of graphics: dot-per-centimeter. 1796 * Also see {@link #createDotPerCentimeter()}. 1797 * @draft ICU 65 1798 */ 1799 static MeasureUnit getDotPerCentimeter(); 1800 #endif /* U_HIDE_DRAFT_API */ 1801 1802 #ifndef U_HIDE_DRAFT_API 1803 /** 1804 * Returns by pointer, unit of graphics: dot-per-inch. 1805 * Caller owns returned value and must free it. 1806 * Also see {@link #getDotPerInch()}. 1807 * @param status ICU error code. 1808 * @draft ICU 65 1809 */ 1810 static MeasureUnit *createDotPerInch(UErrorCode &status); 1811 1812 /** 1813 * Returns by value, unit of graphics: dot-per-inch. 1814 * Also see {@link #createDotPerInch()}. 1815 * @draft ICU 65 1816 */ 1817 static MeasureUnit getDotPerInch(); 1818 #endif /* U_HIDE_DRAFT_API */ 1819 1820 #ifndef U_HIDE_DRAFT_API 1821 /** 1822 * Returns by pointer, unit of graphics: em. 1823 * Caller owns returned value and must free it. 1824 * Also see {@link #getEm()}. 1825 * @param status ICU error code. 1826 * @draft ICU 65 1827 */ 1828 static MeasureUnit *createEm(UErrorCode &status); 1829 1830 /** 1831 * Returns by value, unit of graphics: em. 1832 * Also see {@link #createEm()}. 1833 * @draft ICU 65 1834 */ 1835 static MeasureUnit getEm(); 1836 #endif /* U_HIDE_DRAFT_API */ 1837 1838 #ifndef U_HIDE_DRAFT_API 1839 /** 1840 * Returns by pointer, unit of graphics: megapixel. 1841 * Caller owns returned value and must free it. 1842 * Also see {@link #getMegapixel()}. 1843 * @param status ICU error code. 1844 * @draft ICU 65 1845 */ 1846 static MeasureUnit *createMegapixel(UErrorCode &status); 1847 1848 /** 1849 * Returns by value, unit of graphics: megapixel. 1850 * Also see {@link #createMegapixel()}. 1851 * @draft ICU 65 1852 */ 1853 static MeasureUnit getMegapixel(); 1854 #endif /* U_HIDE_DRAFT_API */ 1855 1856 #ifndef U_HIDE_DRAFT_API 1857 /** 1858 * Returns by pointer, unit of graphics: pixel. 1859 * Caller owns returned value and must free it. 1860 * Also see {@link #getPixel()}. 1861 * @param status ICU error code. 1862 * @draft ICU 65 1863 */ 1864 static MeasureUnit *createPixel(UErrorCode &status); 1865 1866 /** 1867 * Returns by value, unit of graphics: pixel. 1868 * Also see {@link #createPixel()}. 1869 * @draft ICU 65 1870 */ 1871 static MeasureUnit getPixel(); 1872 #endif /* U_HIDE_DRAFT_API */ 1873 1874 #ifndef U_HIDE_DRAFT_API 1875 /** 1876 * Returns by pointer, unit of graphics: pixel-per-centimeter. 1877 * Caller owns returned value and must free it. 1878 * Also see {@link #getPixelPerCentimeter()}. 1879 * @param status ICU error code. 1880 * @draft ICU 65 1881 */ 1882 static MeasureUnit *createPixelPerCentimeter(UErrorCode &status); 1883 1884 /** 1885 * Returns by value, unit of graphics: pixel-per-centimeter. 1886 * Also see {@link #createPixelPerCentimeter()}. 1887 * @draft ICU 65 1888 */ 1889 static MeasureUnit getPixelPerCentimeter(); 1890 #endif /* U_HIDE_DRAFT_API */ 1891 1892 #ifndef U_HIDE_DRAFT_API 1893 /** 1894 * Returns by pointer, unit of graphics: pixel-per-inch. 1895 * Caller owns returned value and must free it. 1896 * Also see {@link #getPixelPerInch()}. 1897 * @param status ICU error code. 1898 * @draft ICU 65 1899 */ 1900 static MeasureUnit *createPixelPerInch(UErrorCode &status); 1901 1902 /** 1903 * Returns by value, unit of graphics: pixel-per-inch. 1904 * Also see {@link #createPixelPerInch()}. 1905 * @draft ICU 65 1906 */ 1907 static MeasureUnit getPixelPerInch(); 1908 #endif /* U_HIDE_DRAFT_API */ 1909 1910 /** 1911 * Returns by pointer, unit of length: astronomical-unit. 1912 * Caller owns returned value and must free it. 1913 * Also see {@link #getAstronomicalUnit()}. 1914 * @param status ICU error code. 1915 * @stable ICU 54 1916 */ 1917 static MeasureUnit *createAstronomicalUnit(UErrorCode &status); 1918 1919 /** 1920 * Returns by value, unit of length: astronomical-unit. 1921 * Also see {@link #createAstronomicalUnit()}. 1922 * @stable ICU 64 1923 */ 1924 static MeasureUnit getAstronomicalUnit(); 1925 1926 /** 1927 * Returns by pointer, unit of length: centimeter. 1928 * Caller owns returned value and must free it. 1929 * Also see {@link #getCentimeter()}. 1930 * @param status ICU error code. 1931 * @stable ICU 53 1932 */ 1933 static MeasureUnit *createCentimeter(UErrorCode &status); 1934 1935 /** 1936 * Returns by value, unit of length: centimeter. 1937 * Also see {@link #createCentimeter()}. 1938 * @stable ICU 64 1939 */ 1940 static MeasureUnit getCentimeter(); 1941 1942 /** 1943 * Returns by pointer, unit of length: decimeter. 1944 * Caller owns returned value and must free it. 1945 * Also see {@link #getDecimeter()}. 1946 * @param status ICU error code. 1947 * @stable ICU 54 1948 */ 1949 static MeasureUnit *createDecimeter(UErrorCode &status); 1950 1951 /** 1952 * Returns by value, unit of length: decimeter. 1953 * Also see {@link #createDecimeter()}. 1954 * @stable ICU 64 1955 */ 1956 static MeasureUnit getDecimeter(); 1957 1958 /** 1959 * Returns by pointer, unit of length: fathom. 1960 * Caller owns returned value and must free it. 1961 * Also see {@link #getFathom()}. 1962 * @param status ICU error code. 1963 * @stable ICU 54 1964 */ 1965 static MeasureUnit *createFathom(UErrorCode &status); 1966 1967 /** 1968 * Returns by value, unit of length: fathom. 1969 * Also see {@link #createFathom()}. 1970 * @stable ICU 64 1971 */ 1972 static MeasureUnit getFathom(); 1973 1974 /** 1975 * Returns by pointer, unit of length: foot. 1976 * Caller owns returned value and must free it. 1977 * Also see {@link #getFoot()}. 1978 * @param status ICU error code. 1979 * @stable ICU 53 1980 */ 1981 static MeasureUnit *createFoot(UErrorCode &status); 1982 1983 /** 1984 * Returns by value, unit of length: foot. 1985 * Also see {@link #createFoot()}. 1986 * @stable ICU 64 1987 */ 1988 static MeasureUnit getFoot(); 1989 1990 /** 1991 * Returns by pointer, unit of length: furlong. 1992 * Caller owns returned value and must free it. 1993 * Also see {@link #getFurlong()}. 1994 * @param status ICU error code. 1995 * @stable ICU 54 1996 */ 1997 static MeasureUnit *createFurlong(UErrorCode &status); 1998 1999 /** 2000 * Returns by value, unit of length: furlong. 2001 * Also see {@link #createFurlong()}. 2002 * @stable ICU 64 2003 */ 2004 static MeasureUnit getFurlong(); 2005 2006 /** 2007 * Returns by pointer, unit of length: inch. 2008 * Caller owns returned value and must free it. 2009 * Also see {@link #getInch()}. 2010 * @param status ICU error code. 2011 * @stable ICU 53 2012 */ 2013 static MeasureUnit *createInch(UErrorCode &status); 2014 2015 /** 2016 * Returns by value, unit of length: inch. 2017 * Also see {@link #createInch()}. 2018 * @stable ICU 64 2019 */ 2020 static MeasureUnit getInch(); 2021 2022 /** 2023 * Returns by pointer, unit of length: kilometer. 2024 * Caller owns returned value and must free it. 2025 * Also see {@link #getKilometer()}. 2026 * @param status ICU error code. 2027 * @stable ICU 53 2028 */ 2029 static MeasureUnit *createKilometer(UErrorCode &status); 2030 2031 /** 2032 * Returns by value, unit of length: kilometer. 2033 * Also see {@link #createKilometer()}. 2034 * @stable ICU 64 2035 */ 2036 static MeasureUnit getKilometer(); 2037 2038 /** 2039 * Returns by pointer, unit of length: light-year. 2040 * Caller owns returned value and must free it. 2041 * Also see {@link #getLightYear()}. 2042 * @param status ICU error code. 2043 * @stable ICU 53 2044 */ 2045 static MeasureUnit *createLightYear(UErrorCode &status); 2046 2047 /** 2048 * Returns by value, unit of length: light-year. 2049 * Also see {@link #createLightYear()}. 2050 * @stable ICU 64 2051 */ 2052 static MeasureUnit getLightYear(); 2053 2054 /** 2055 * Returns by pointer, unit of length: meter. 2056 * Caller owns returned value and must free it. 2057 * Also see {@link #getMeter()}. 2058 * @param status ICU error code. 2059 * @stable ICU 53 2060 */ 2061 static MeasureUnit *createMeter(UErrorCode &status); 2062 2063 /** 2064 * Returns by value, unit of length: meter. 2065 * Also see {@link #createMeter()}. 2066 * @stable ICU 64 2067 */ 2068 static MeasureUnit getMeter(); 2069 2070 /** 2071 * Returns by pointer, unit of length: micrometer. 2072 * Caller owns returned value and must free it. 2073 * Also see {@link #getMicrometer()}. 2074 * @param status ICU error code. 2075 * @stable ICU 54 2076 */ 2077 static MeasureUnit *createMicrometer(UErrorCode &status); 2078 2079 /** 2080 * Returns by value, unit of length: micrometer. 2081 * Also see {@link #createMicrometer()}. 2082 * @stable ICU 64 2083 */ 2084 static MeasureUnit getMicrometer(); 2085 2086 /** 2087 * Returns by pointer, unit of length: mile. 2088 * Caller owns returned value and must free it. 2089 * Also see {@link #getMile()}. 2090 * @param status ICU error code. 2091 * @stable ICU 53 2092 */ 2093 static MeasureUnit *createMile(UErrorCode &status); 2094 2095 /** 2096 * Returns by value, unit of length: mile. 2097 * Also see {@link #createMile()}. 2098 * @stable ICU 64 2099 */ 2100 static MeasureUnit getMile(); 2101 2102 /** 2103 * Returns by pointer, unit of length: mile-scandinavian. 2104 * Caller owns returned value and must free it. 2105 * Also see {@link #getMileScandinavian()}. 2106 * @param status ICU error code. 2107 * @stable ICU 56 2108 */ 2109 static MeasureUnit *createMileScandinavian(UErrorCode &status); 2110 2111 /** 2112 * Returns by value, unit of length: mile-scandinavian. 2113 * Also see {@link #createMileScandinavian()}. 2114 * @stable ICU 64 2115 */ 2116 static MeasureUnit getMileScandinavian(); 2117 2118 /** 2119 * Returns by pointer, unit of length: millimeter. 2120 * Caller owns returned value and must free it. 2121 * Also see {@link #getMillimeter()}. 2122 * @param status ICU error code. 2123 * @stable ICU 53 2124 */ 2125 static MeasureUnit *createMillimeter(UErrorCode &status); 2126 2127 /** 2128 * Returns by value, unit of length: millimeter. 2129 * Also see {@link #createMillimeter()}. 2130 * @stable ICU 64 2131 */ 2132 static MeasureUnit getMillimeter(); 2133 2134 /** 2135 * Returns by pointer, unit of length: nanometer. 2136 * Caller owns returned value and must free it. 2137 * Also see {@link #getNanometer()}. 2138 * @param status ICU error code. 2139 * @stable ICU 54 2140 */ 2141 static MeasureUnit *createNanometer(UErrorCode &status); 2142 2143 /** 2144 * Returns by value, unit of length: nanometer. 2145 * Also see {@link #createNanometer()}. 2146 * @stable ICU 64 2147 */ 2148 static MeasureUnit getNanometer(); 2149 2150 /** 2151 * Returns by pointer, unit of length: nautical-mile. 2152 * Caller owns returned value and must free it. 2153 * Also see {@link #getNauticalMile()}. 2154 * @param status ICU error code. 2155 * @stable ICU 54 2156 */ 2157 static MeasureUnit *createNauticalMile(UErrorCode &status); 2158 2159 /** 2160 * Returns by value, unit of length: nautical-mile. 2161 * Also see {@link #createNauticalMile()}. 2162 * @stable ICU 64 2163 */ 2164 static MeasureUnit getNauticalMile(); 2165 2166 /** 2167 * Returns by pointer, unit of length: parsec. 2168 * Caller owns returned value and must free it. 2169 * Also see {@link #getParsec()}. 2170 * @param status ICU error code. 2171 * @stable ICU 54 2172 */ 2173 static MeasureUnit *createParsec(UErrorCode &status); 2174 2175 /** 2176 * Returns by value, unit of length: parsec. 2177 * Also see {@link #createParsec()}. 2178 * @stable ICU 64 2179 */ 2180 static MeasureUnit getParsec(); 2181 2182 /** 2183 * Returns by pointer, unit of length: picometer. 2184 * Caller owns returned value and must free it. 2185 * Also see {@link #getPicometer()}. 2186 * @param status ICU error code. 2187 * @stable ICU 53 2188 */ 2189 static MeasureUnit *createPicometer(UErrorCode &status); 2190 2191 /** 2192 * Returns by value, unit of length: picometer. 2193 * Also see {@link #createPicometer()}. 2194 * @stable ICU 64 2195 */ 2196 static MeasureUnit getPicometer(); 2197 2198 /** 2199 * Returns by pointer, unit of length: point. 2200 * Caller owns returned value and must free it. 2201 * Also see {@link #getPoint()}. 2202 * @param status ICU error code. 2203 * @stable ICU 59 2204 */ 2205 static MeasureUnit *createPoint(UErrorCode &status); 2206 2207 /** 2208 * Returns by value, unit of length: point. 2209 * Also see {@link #createPoint()}. 2210 * @stable ICU 64 2211 */ 2212 static MeasureUnit getPoint(); 2213 2214 /** 2215 * Returns by pointer, unit of length: solar-radius. 2216 * Caller owns returned value and must free it. 2217 * Also see {@link #getSolarRadius()}. 2218 * @param status ICU error code. 2219 * @stable ICU 64 2220 */ 2221 static MeasureUnit *createSolarRadius(UErrorCode &status); 2222 2223 /** 2224 * Returns by value, unit of length: solar-radius. 2225 * Also see {@link #createSolarRadius()}. 2226 * @stable ICU 64 2227 */ 2228 static MeasureUnit getSolarRadius(); 2229 2230 /** 2231 * Returns by pointer, unit of length: yard. 2232 * Caller owns returned value and must free it. 2233 * Also see {@link #getYard()}. 2234 * @param status ICU error code. 2235 * @stable ICU 53 2236 */ 2237 static MeasureUnit *createYard(UErrorCode &status); 2238 2239 /** 2240 * Returns by value, unit of length: yard. 2241 * Also see {@link #createYard()}. 2242 * @stable ICU 64 2243 */ 2244 static MeasureUnit getYard(); 2245 2246 /** 2247 * Returns by pointer, unit of light: lux. 2248 * Caller owns returned value and must free it. 2249 * Also see {@link #getLux()}. 2250 * @param status ICU error code. 2251 * @stable ICU 54 2252 */ 2253 static MeasureUnit *createLux(UErrorCode &status); 2254 2255 /** 2256 * Returns by value, unit of light: lux. 2257 * Also see {@link #createLux()}. 2258 * @stable ICU 64 2259 */ 2260 static MeasureUnit getLux(); 2261 2262 /** 2263 * Returns by pointer, unit of light: solar-luminosity. 2264 * Caller owns returned value and must free it. 2265 * Also see {@link #getSolarLuminosity()}. 2266 * @param status ICU error code. 2267 * @stable ICU 64 2268 */ 2269 static MeasureUnit *createSolarLuminosity(UErrorCode &status); 2270 2271 /** 2272 * Returns by value, unit of light: solar-luminosity. 2273 * Also see {@link #createSolarLuminosity()}. 2274 * @stable ICU 64 2275 */ 2276 static MeasureUnit getSolarLuminosity(); 2277 2278 /** 2279 * Returns by pointer, unit of mass: carat. 2280 * Caller owns returned value and must free it. 2281 * Also see {@link #getCarat()}. 2282 * @param status ICU error code. 2283 * @stable ICU 54 2284 */ 2285 static MeasureUnit *createCarat(UErrorCode &status); 2286 2287 /** 2288 * Returns by value, unit of mass: carat. 2289 * Also see {@link #createCarat()}. 2290 * @stable ICU 64 2291 */ 2292 static MeasureUnit getCarat(); 2293 2294 /** 2295 * Returns by pointer, unit of mass: dalton. 2296 * Caller owns returned value and must free it. 2297 * Also see {@link #getDalton()}. 2298 * @param status ICU error code. 2299 * @stable ICU 64 2300 */ 2301 static MeasureUnit *createDalton(UErrorCode &status); 2302 2303 /** 2304 * Returns by value, unit of mass: dalton. 2305 * Also see {@link #createDalton()}. 2306 * @stable ICU 64 2307 */ 2308 static MeasureUnit getDalton(); 2309 2310 /** 2311 * Returns by pointer, unit of mass: earth-mass. 2312 * Caller owns returned value and must free it. 2313 * Also see {@link #getEarthMass()}. 2314 * @param status ICU error code. 2315 * @stable ICU 64 2316 */ 2317 static MeasureUnit *createEarthMass(UErrorCode &status); 2318 2319 /** 2320 * Returns by value, unit of mass: earth-mass. 2321 * Also see {@link #createEarthMass()}. 2322 * @stable ICU 64 2323 */ 2324 static MeasureUnit getEarthMass(); 2325 2326 /** 2327 * Returns by pointer, unit of mass: gram. 2328 * Caller owns returned value and must free it. 2329 * Also see {@link #getGram()}. 2330 * @param status ICU error code. 2331 * @stable ICU 53 2332 */ 2333 static MeasureUnit *createGram(UErrorCode &status); 2334 2335 /** 2336 * Returns by value, unit of mass: gram. 2337 * Also see {@link #createGram()}. 2338 * @stable ICU 64 2339 */ 2340 static MeasureUnit getGram(); 2341 2342 /** 2343 * Returns by pointer, unit of mass: kilogram. 2344 * Caller owns returned value and must free it. 2345 * Also see {@link #getKilogram()}. 2346 * @param status ICU error code. 2347 * @stable ICU 53 2348 */ 2349 static MeasureUnit *createKilogram(UErrorCode &status); 2350 2351 /** 2352 * Returns by value, unit of mass: kilogram. 2353 * Also see {@link #createKilogram()}. 2354 * @stable ICU 64 2355 */ 2356 static MeasureUnit getKilogram(); 2357 2358 /** 2359 * Returns by pointer, unit of mass: metric-ton. 2360 * Caller owns returned value and must free it. 2361 * Also see {@link #getMetricTon()}. 2362 * @param status ICU error code. 2363 * @stable ICU 54 2364 */ 2365 static MeasureUnit *createMetricTon(UErrorCode &status); 2366 2367 /** 2368 * Returns by value, unit of mass: metric-ton. 2369 * Also see {@link #createMetricTon()}. 2370 * @stable ICU 64 2371 */ 2372 static MeasureUnit getMetricTon(); 2373 2374 /** 2375 * Returns by pointer, unit of mass: microgram. 2376 * Caller owns returned value and must free it. 2377 * Also see {@link #getMicrogram()}. 2378 * @param status ICU error code. 2379 * @stable ICU 54 2380 */ 2381 static MeasureUnit *createMicrogram(UErrorCode &status); 2382 2383 /** 2384 * Returns by value, unit of mass: microgram. 2385 * Also see {@link #createMicrogram()}. 2386 * @stable ICU 64 2387 */ 2388 static MeasureUnit getMicrogram(); 2389 2390 /** 2391 * Returns by pointer, unit of mass: milligram. 2392 * Caller owns returned value and must free it. 2393 * Also see {@link #getMilligram()}. 2394 * @param status ICU error code. 2395 * @stable ICU 54 2396 */ 2397 static MeasureUnit *createMilligram(UErrorCode &status); 2398 2399 /** 2400 * Returns by value, unit of mass: milligram. 2401 * Also see {@link #createMilligram()}. 2402 * @stable ICU 64 2403 */ 2404 static MeasureUnit getMilligram(); 2405 2406 /** 2407 * Returns by pointer, unit of mass: ounce. 2408 * Caller owns returned value and must free it. 2409 * Also see {@link #getOunce()}. 2410 * @param status ICU error code. 2411 * @stable ICU 53 2412 */ 2413 static MeasureUnit *createOunce(UErrorCode &status); 2414 2415 /** 2416 * Returns by value, unit of mass: ounce. 2417 * Also see {@link #createOunce()}. 2418 * @stable ICU 64 2419 */ 2420 static MeasureUnit getOunce(); 2421 2422 /** 2423 * Returns by pointer, unit of mass: ounce-troy. 2424 * Caller owns returned value and must free it. 2425 * Also see {@link #getOunceTroy()}. 2426 * @param status ICU error code. 2427 * @stable ICU 54 2428 */ 2429 static MeasureUnit *createOunceTroy(UErrorCode &status); 2430 2431 /** 2432 * Returns by value, unit of mass: ounce-troy. 2433 * Also see {@link #createOunceTroy()}. 2434 * @stable ICU 64 2435 */ 2436 static MeasureUnit getOunceTroy(); 2437 2438 /** 2439 * Returns by pointer, unit of mass: pound. 2440 * Caller owns returned value and must free it. 2441 * Also see {@link #getPound()}. 2442 * @param status ICU error code. 2443 * @stable ICU 53 2444 */ 2445 static MeasureUnit *createPound(UErrorCode &status); 2446 2447 /** 2448 * Returns by value, unit of mass: pound. 2449 * Also see {@link #createPound()}. 2450 * @stable ICU 64 2451 */ 2452 static MeasureUnit getPound(); 2453 2454 /** 2455 * Returns by pointer, unit of mass: solar-mass. 2456 * Caller owns returned value and must free it. 2457 * Also see {@link #getSolarMass()}. 2458 * @param status ICU error code. 2459 * @stable ICU 64 2460 */ 2461 static MeasureUnit *createSolarMass(UErrorCode &status); 2462 2463 /** 2464 * Returns by value, unit of mass: solar-mass. 2465 * Also see {@link #createSolarMass()}. 2466 * @stable ICU 64 2467 */ 2468 static MeasureUnit getSolarMass(); 2469 2470 /** 2471 * Returns by pointer, unit of mass: stone. 2472 * Caller owns returned value and must free it. 2473 * Also see {@link #getStone()}. 2474 * @param status ICU error code. 2475 * @stable ICU 54 2476 */ 2477 static MeasureUnit *createStone(UErrorCode &status); 2478 2479 /** 2480 * Returns by value, unit of mass: stone. 2481 * Also see {@link #createStone()}. 2482 * @stable ICU 64 2483 */ 2484 static MeasureUnit getStone(); 2485 2486 /** 2487 * Returns by pointer, unit of mass: ton. 2488 * Caller owns returned value and must free it. 2489 * Also see {@link #getTon()}. 2490 * @param status ICU error code. 2491 * @stable ICU 54 2492 */ 2493 static MeasureUnit *createTon(UErrorCode &status); 2494 2495 /** 2496 * Returns by value, unit of mass: ton. 2497 * Also see {@link #createTon()}. 2498 * @stable ICU 64 2499 */ 2500 static MeasureUnit getTon(); 2501 2502 /** 2503 * Returns by pointer, unit of power: gigawatt. 2504 * Caller owns returned value and must free it. 2505 * Also see {@link #getGigawatt()}. 2506 * @param status ICU error code. 2507 * @stable ICU 54 2508 */ 2509 static MeasureUnit *createGigawatt(UErrorCode &status); 2510 2511 /** 2512 * Returns by value, unit of power: gigawatt. 2513 * Also see {@link #createGigawatt()}. 2514 * @stable ICU 64 2515 */ 2516 static MeasureUnit getGigawatt(); 2517 2518 /** 2519 * Returns by pointer, unit of power: horsepower. 2520 * Caller owns returned value and must free it. 2521 * Also see {@link #getHorsepower()}. 2522 * @param status ICU error code. 2523 * @stable ICU 53 2524 */ 2525 static MeasureUnit *createHorsepower(UErrorCode &status); 2526 2527 /** 2528 * Returns by value, unit of power: horsepower. 2529 * Also see {@link #createHorsepower()}. 2530 * @stable ICU 64 2531 */ 2532 static MeasureUnit getHorsepower(); 2533 2534 /** 2535 * Returns by pointer, unit of power: kilowatt. 2536 * Caller owns returned value and must free it. 2537 * Also see {@link #getKilowatt()}. 2538 * @param status ICU error code. 2539 * @stable ICU 53 2540 */ 2541 static MeasureUnit *createKilowatt(UErrorCode &status); 2542 2543 /** 2544 * Returns by value, unit of power: kilowatt. 2545 * Also see {@link #createKilowatt()}. 2546 * @stable ICU 64 2547 */ 2548 static MeasureUnit getKilowatt(); 2549 2550 /** 2551 * Returns by pointer, unit of power: megawatt. 2552 * Caller owns returned value and must free it. 2553 * Also see {@link #getMegawatt()}. 2554 * @param status ICU error code. 2555 * @stable ICU 54 2556 */ 2557 static MeasureUnit *createMegawatt(UErrorCode &status); 2558 2559 /** 2560 * Returns by value, unit of power: megawatt. 2561 * Also see {@link #createMegawatt()}. 2562 * @stable ICU 64 2563 */ 2564 static MeasureUnit getMegawatt(); 2565 2566 /** 2567 * Returns by pointer, unit of power: milliwatt. 2568 * Caller owns returned value and must free it. 2569 * Also see {@link #getMilliwatt()}. 2570 * @param status ICU error code. 2571 * @stable ICU 54 2572 */ 2573 static MeasureUnit *createMilliwatt(UErrorCode &status); 2574 2575 /** 2576 * Returns by value, unit of power: milliwatt. 2577 * Also see {@link #createMilliwatt()}. 2578 * @stable ICU 64 2579 */ 2580 static MeasureUnit getMilliwatt(); 2581 2582 /** 2583 * Returns by pointer, unit of power: watt. 2584 * Caller owns returned value and must free it. 2585 * Also see {@link #getWatt()}. 2586 * @param status ICU error code. 2587 * @stable ICU 53 2588 */ 2589 static MeasureUnit *createWatt(UErrorCode &status); 2590 2591 /** 2592 * Returns by value, unit of power: watt. 2593 * Also see {@link #createWatt()}. 2594 * @stable ICU 64 2595 */ 2596 static MeasureUnit getWatt(); 2597 2598 /** 2599 * Returns by pointer, unit of pressure: atmosphere. 2600 * Caller owns returned value and must free it. 2601 * Also see {@link #getAtmosphere()}. 2602 * @param status ICU error code. 2603 * @stable ICU 63 2604 */ 2605 static MeasureUnit *createAtmosphere(UErrorCode &status); 2606 2607 /** 2608 * Returns by value, unit of pressure: atmosphere. 2609 * Also see {@link #createAtmosphere()}. 2610 * @stable ICU 64 2611 */ 2612 static MeasureUnit getAtmosphere(); 2613 2614 #ifndef U_HIDE_DRAFT_API 2615 /** 2616 * Returns by pointer, unit of pressure: bar. 2617 * Caller owns returned value and must free it. 2618 * Also see {@link #getBar()}. 2619 * @param status ICU error code. 2620 * @draft ICU 65 2621 */ 2622 static MeasureUnit *createBar(UErrorCode &status); 2623 2624 /** 2625 * Returns by value, unit of pressure: bar. 2626 * Also see {@link #createBar()}. 2627 * @draft ICU 65 2628 */ 2629 static MeasureUnit getBar(); 2630 #endif /* U_HIDE_DRAFT_API */ 2631 2632 /** 2633 * Returns by pointer, unit of pressure: hectopascal. 2634 * Caller owns returned value and must free it. 2635 * Also see {@link #getHectopascal()}. 2636 * @param status ICU error code. 2637 * @stable ICU 53 2638 */ 2639 static MeasureUnit *createHectopascal(UErrorCode &status); 2640 2641 /** 2642 * Returns by value, unit of pressure: hectopascal. 2643 * Also see {@link #createHectopascal()}. 2644 * @stable ICU 64 2645 */ 2646 static MeasureUnit getHectopascal(); 2647 2648 /** 2649 * Returns by pointer, unit of pressure: inch-ofhg. 2650 * Caller owns returned value and must free it. 2651 * Also see {@link #getInchHg()}. 2652 * @param status ICU error code. 2653 * @stable ICU 53 2654 */ 2655 static MeasureUnit *createInchHg(UErrorCode &status); 2656 2657 /** 2658 * Returns by value, unit of pressure: inch-ofhg. 2659 * Also see {@link #createInchHg()}. 2660 * @stable ICU 64 2661 */ 2662 static MeasureUnit getInchHg(); 2663 2664 /** 2665 * Returns by pointer, unit of pressure: kilopascal. 2666 * Caller owns returned value and must free it. 2667 * Also see {@link #getKilopascal()}. 2668 * @param status ICU error code. 2669 * @stable ICU 64 2670 */ 2671 static MeasureUnit *createKilopascal(UErrorCode &status); 2672 2673 /** 2674 * Returns by value, unit of pressure: kilopascal. 2675 * Also see {@link #createKilopascal()}. 2676 * @stable ICU 64 2677 */ 2678 static MeasureUnit getKilopascal(); 2679 2680 /** 2681 * Returns by pointer, unit of pressure: megapascal. 2682 * Caller owns returned value and must free it. 2683 * Also see {@link #getMegapascal()}. 2684 * @param status ICU error code. 2685 * @stable ICU 64 2686 */ 2687 static MeasureUnit *createMegapascal(UErrorCode &status); 2688 2689 /** 2690 * Returns by value, unit of pressure: megapascal. 2691 * Also see {@link #createMegapascal()}. 2692 * @stable ICU 64 2693 */ 2694 static MeasureUnit getMegapascal(); 2695 2696 /** 2697 * Returns by pointer, unit of pressure: millibar. 2698 * Caller owns returned value and must free it. 2699 * Also see {@link #getMillibar()}. 2700 * @param status ICU error code. 2701 * @stable ICU 53 2702 */ 2703 static MeasureUnit *createMillibar(UErrorCode &status); 2704 2705 /** 2706 * Returns by value, unit of pressure: millibar. 2707 * Also see {@link #createMillibar()}. 2708 * @stable ICU 64 2709 */ 2710 static MeasureUnit getMillibar(); 2711 2712 /** 2713 * Returns by pointer, unit of pressure: millimeter-ofhg. 2714 * Caller owns returned value and must free it. 2715 * Also see {@link #getMillimeterOfMercury()}. 2716 * @param status ICU error code. 2717 * @stable ICU 54 2718 */ 2719 static MeasureUnit *createMillimeterOfMercury(UErrorCode &status); 2720 2721 /** 2722 * Returns by value, unit of pressure: millimeter-ofhg. 2723 * Also see {@link #createMillimeterOfMercury()}. 2724 * @stable ICU 64 2725 */ 2726 static MeasureUnit getMillimeterOfMercury(); 2727 2728 #ifndef U_HIDE_DRAFT_API 2729 /** 2730 * Returns by pointer, unit of pressure: pascal. 2731 * Caller owns returned value and must free it. 2732 * Also see {@link #getPascal()}. 2733 * @param status ICU error code. 2734 * @draft ICU 65 2735 */ 2736 static MeasureUnit *createPascal(UErrorCode &status); 2737 2738 /** 2739 * Returns by value, unit of pressure: pascal. 2740 * Also see {@link #createPascal()}. 2741 * @draft ICU 65 2742 */ 2743 static MeasureUnit getPascal(); 2744 #endif /* U_HIDE_DRAFT_API */ 2745 2746 /** 2747 * Returns by pointer, unit of pressure: pound-force-per-square-inch. 2748 * Caller owns returned value and must free it. 2749 * Also see {@link #getPoundPerSquareInch()}. 2750 * @param status ICU error code. 2751 * @stable ICU 54 2752 */ 2753 static MeasureUnit *createPoundPerSquareInch(UErrorCode &status); 2754 2755 /** 2756 * Returns by value, unit of pressure: pound-force-per-square-inch. 2757 * Also see {@link #createPoundPerSquareInch()}. 2758 * @stable ICU 64 2759 */ 2760 static MeasureUnit getPoundPerSquareInch(); 2761 2762 /** 2763 * Returns by pointer, unit of speed: kilometer-per-hour. 2764 * Caller owns returned value and must free it. 2765 * Also see {@link #getKilometerPerHour()}. 2766 * @param status ICU error code. 2767 * @stable ICU 53 2768 */ 2769 static MeasureUnit *createKilometerPerHour(UErrorCode &status); 2770 2771 /** 2772 * Returns by value, unit of speed: kilometer-per-hour. 2773 * Also see {@link #createKilometerPerHour()}. 2774 * @stable ICU 64 2775 */ 2776 static MeasureUnit getKilometerPerHour(); 2777 2778 /** 2779 * Returns by pointer, unit of speed: knot. 2780 * Caller owns returned value and must free it. 2781 * Also see {@link #getKnot()}. 2782 * @param status ICU error code. 2783 * @stable ICU 56 2784 */ 2785 static MeasureUnit *createKnot(UErrorCode &status); 2786 2787 /** 2788 * Returns by value, unit of speed: knot. 2789 * Also see {@link #createKnot()}. 2790 * @stable ICU 64 2791 */ 2792 static MeasureUnit getKnot(); 2793 2794 /** 2795 * Returns by pointer, unit of speed: meter-per-second. 2796 * Caller owns returned value and must free it. 2797 * Also see {@link #getMeterPerSecond()}. 2798 * @param status ICU error code. 2799 * @stable ICU 53 2800 */ 2801 static MeasureUnit *createMeterPerSecond(UErrorCode &status); 2802 2803 /** 2804 * Returns by value, unit of speed: meter-per-second. 2805 * Also see {@link #createMeterPerSecond()}. 2806 * @stable ICU 64 2807 */ 2808 static MeasureUnit getMeterPerSecond(); 2809 2810 /** 2811 * Returns by pointer, unit of speed: mile-per-hour. 2812 * Caller owns returned value and must free it. 2813 * Also see {@link #getMilePerHour()}. 2814 * @param status ICU error code. 2815 * @stable ICU 53 2816 */ 2817 static MeasureUnit *createMilePerHour(UErrorCode &status); 2818 2819 /** 2820 * Returns by value, unit of speed: mile-per-hour. 2821 * Also see {@link #createMilePerHour()}. 2822 * @stable ICU 64 2823 */ 2824 static MeasureUnit getMilePerHour(); 2825 2826 /** 2827 * Returns by pointer, unit of temperature: celsius. 2828 * Caller owns returned value and must free it. 2829 * Also see {@link #getCelsius()}. 2830 * @param status ICU error code. 2831 * @stable ICU 53 2832 */ 2833 static MeasureUnit *createCelsius(UErrorCode &status); 2834 2835 /** 2836 * Returns by value, unit of temperature: celsius. 2837 * Also see {@link #createCelsius()}. 2838 * @stable ICU 64 2839 */ 2840 static MeasureUnit getCelsius(); 2841 2842 /** 2843 * Returns by pointer, unit of temperature: fahrenheit. 2844 * Caller owns returned value and must free it. 2845 * Also see {@link #getFahrenheit()}. 2846 * @param status ICU error code. 2847 * @stable ICU 53 2848 */ 2849 static MeasureUnit *createFahrenheit(UErrorCode &status); 2850 2851 /** 2852 * Returns by value, unit of temperature: fahrenheit. 2853 * Also see {@link #createFahrenheit()}. 2854 * @stable ICU 64 2855 */ 2856 static MeasureUnit getFahrenheit(); 2857 2858 /** 2859 * Returns by pointer, unit of temperature: generic. 2860 * Caller owns returned value and must free it. 2861 * Also see {@link #getGenericTemperature()}. 2862 * @param status ICU error code. 2863 * @stable ICU 56 2864 */ 2865 static MeasureUnit *createGenericTemperature(UErrorCode &status); 2866 2867 /** 2868 * Returns by value, unit of temperature: generic. 2869 * Also see {@link #createGenericTemperature()}. 2870 * @stable ICU 64 2871 */ 2872 static MeasureUnit getGenericTemperature(); 2873 2874 /** 2875 * Returns by pointer, unit of temperature: kelvin. 2876 * Caller owns returned value and must free it. 2877 * Also see {@link #getKelvin()}. 2878 * @param status ICU error code. 2879 * @stable ICU 54 2880 */ 2881 static MeasureUnit *createKelvin(UErrorCode &status); 2882 2883 /** 2884 * Returns by value, unit of temperature: kelvin. 2885 * Also see {@link #createKelvin()}. 2886 * @stable ICU 64 2887 */ 2888 static MeasureUnit getKelvin(); 2889 2890 /** 2891 * Returns by pointer, unit of torque: newton-meter. 2892 * Caller owns returned value and must free it. 2893 * Also see {@link #getNewtonMeter()}. 2894 * @param status ICU error code. 2895 * @stable ICU 64 2896 */ 2897 static MeasureUnit *createNewtonMeter(UErrorCode &status); 2898 2899 /** 2900 * Returns by value, unit of torque: newton-meter. 2901 * Also see {@link #createNewtonMeter()}. 2902 * @stable ICU 64 2903 */ 2904 static MeasureUnit getNewtonMeter(); 2905 2906 /** 2907 * Returns by pointer, unit of torque: pound-force-foot. 2908 * Caller owns returned value and must free it. 2909 * Also see {@link #getPoundFoot()}. 2910 * @param status ICU error code. 2911 * @stable ICU 64 2912 */ 2913 static MeasureUnit *createPoundFoot(UErrorCode &status); 2914 2915 /** 2916 * Returns by value, unit of torque: pound-force-foot. 2917 * Also see {@link #createPoundFoot()}. 2918 * @stable ICU 64 2919 */ 2920 static MeasureUnit getPoundFoot(); 2921 2922 /** 2923 * Returns by pointer, unit of volume: acre-foot. 2924 * Caller owns returned value and must free it. 2925 * Also see {@link #getAcreFoot()}. 2926 * @param status ICU error code. 2927 * @stable ICU 54 2928 */ 2929 static MeasureUnit *createAcreFoot(UErrorCode &status); 2930 2931 /** 2932 * Returns by value, unit of volume: acre-foot. 2933 * Also see {@link #createAcreFoot()}. 2934 * @stable ICU 64 2935 */ 2936 static MeasureUnit getAcreFoot(); 2937 2938 /** 2939 * Returns by pointer, unit of volume: barrel. 2940 * Caller owns returned value and must free it. 2941 * Also see {@link #getBarrel()}. 2942 * @param status ICU error code. 2943 * @stable ICU 64 2944 */ 2945 static MeasureUnit *createBarrel(UErrorCode &status); 2946 2947 /** 2948 * Returns by value, unit of volume: barrel. 2949 * Also see {@link #createBarrel()}. 2950 * @stable ICU 64 2951 */ 2952 static MeasureUnit getBarrel(); 2953 2954 /** 2955 * Returns by pointer, unit of volume: bushel. 2956 * Caller owns returned value and must free it. 2957 * Also see {@link #getBushel()}. 2958 * @param status ICU error code. 2959 * @stable ICU 54 2960 */ 2961 static MeasureUnit *createBushel(UErrorCode &status); 2962 2963 /** 2964 * Returns by value, unit of volume: bushel. 2965 * Also see {@link #createBushel()}. 2966 * @stable ICU 64 2967 */ 2968 static MeasureUnit getBushel(); 2969 2970 /** 2971 * Returns by pointer, unit of volume: centiliter. 2972 * Caller owns returned value and must free it. 2973 * Also see {@link #getCentiliter()}. 2974 * @param status ICU error code. 2975 * @stable ICU 54 2976 */ 2977 static MeasureUnit *createCentiliter(UErrorCode &status); 2978 2979 /** 2980 * Returns by value, unit of volume: centiliter. 2981 * Also see {@link #createCentiliter()}. 2982 * @stable ICU 64 2983 */ 2984 static MeasureUnit getCentiliter(); 2985 2986 /** 2987 * Returns by pointer, unit of volume: cubic-centimeter. 2988 * Caller owns returned value and must free it. 2989 * Also see {@link #getCubicCentimeter()}. 2990 * @param status ICU error code. 2991 * @stable ICU 54 2992 */ 2993 static MeasureUnit *createCubicCentimeter(UErrorCode &status); 2994 2995 /** 2996 * Returns by value, unit of volume: cubic-centimeter. 2997 * Also see {@link #createCubicCentimeter()}. 2998 * @stable ICU 64 2999 */ 3000 static MeasureUnit getCubicCentimeter(); 3001 3002 /** 3003 * Returns by pointer, unit of volume: cubic-foot. 3004 * Caller owns returned value and must free it. 3005 * Also see {@link #getCubicFoot()}. 3006 * @param status ICU error code. 3007 * @stable ICU 54 3008 */ 3009 static MeasureUnit *createCubicFoot(UErrorCode &status); 3010 3011 /** 3012 * Returns by value, unit of volume: cubic-foot. 3013 * Also see {@link #createCubicFoot()}. 3014 * @stable ICU 64 3015 */ 3016 static MeasureUnit getCubicFoot(); 3017 3018 /** 3019 * Returns by pointer, unit of volume: cubic-inch. 3020 * Caller owns returned value and must free it. 3021 * Also see {@link #getCubicInch()}. 3022 * @param status ICU error code. 3023 * @stable ICU 54 3024 */ 3025 static MeasureUnit *createCubicInch(UErrorCode &status); 3026 3027 /** 3028 * Returns by value, unit of volume: cubic-inch. 3029 * Also see {@link #createCubicInch()}. 3030 * @stable ICU 64 3031 */ 3032 static MeasureUnit getCubicInch(); 3033 3034 /** 3035 * Returns by pointer, unit of volume: cubic-kilometer. 3036 * Caller owns returned value and must free it. 3037 * Also see {@link #getCubicKilometer()}. 3038 * @param status ICU error code. 3039 * @stable ICU 53 3040 */ 3041 static MeasureUnit *createCubicKilometer(UErrorCode &status); 3042 3043 /** 3044 * Returns by value, unit of volume: cubic-kilometer. 3045 * Also see {@link #createCubicKilometer()}. 3046 * @stable ICU 64 3047 */ 3048 static MeasureUnit getCubicKilometer(); 3049 3050 /** 3051 * Returns by pointer, unit of volume: cubic-meter. 3052 * Caller owns returned value and must free it. 3053 * Also see {@link #getCubicMeter()}. 3054 * @param status ICU error code. 3055 * @stable ICU 54 3056 */ 3057 static MeasureUnit *createCubicMeter(UErrorCode &status); 3058 3059 /** 3060 * Returns by value, unit of volume: cubic-meter. 3061 * Also see {@link #createCubicMeter()}. 3062 * @stable ICU 64 3063 */ 3064 static MeasureUnit getCubicMeter(); 3065 3066 /** 3067 * Returns by pointer, unit of volume: cubic-mile. 3068 * Caller owns returned value and must free it. 3069 * Also see {@link #getCubicMile()}. 3070 * @param status ICU error code. 3071 * @stable ICU 53 3072 */ 3073 static MeasureUnit *createCubicMile(UErrorCode &status); 3074 3075 /** 3076 * Returns by value, unit of volume: cubic-mile. 3077 * Also see {@link #createCubicMile()}. 3078 * @stable ICU 64 3079 */ 3080 static MeasureUnit getCubicMile(); 3081 3082 /** 3083 * Returns by pointer, unit of volume: cubic-yard. 3084 * Caller owns returned value and must free it. 3085 * Also see {@link #getCubicYard()}. 3086 * @param status ICU error code. 3087 * @stable ICU 54 3088 */ 3089 static MeasureUnit *createCubicYard(UErrorCode &status); 3090 3091 /** 3092 * Returns by value, unit of volume: cubic-yard. 3093 * Also see {@link #createCubicYard()}. 3094 * @stable ICU 64 3095 */ 3096 static MeasureUnit getCubicYard(); 3097 3098 /** 3099 * Returns by pointer, unit of volume: cup. 3100 * Caller owns returned value and must free it. 3101 * Also see {@link #getCup()}. 3102 * @param status ICU error code. 3103 * @stable ICU 54 3104 */ 3105 static MeasureUnit *createCup(UErrorCode &status); 3106 3107 /** 3108 * Returns by value, unit of volume: cup. 3109 * Also see {@link #createCup()}. 3110 * @stable ICU 64 3111 */ 3112 static MeasureUnit getCup(); 3113 3114 /** 3115 * Returns by pointer, unit of volume: cup-metric. 3116 * Caller owns returned value and must free it. 3117 * Also see {@link #getCupMetric()}. 3118 * @param status ICU error code. 3119 * @stable ICU 56 3120 */ 3121 static MeasureUnit *createCupMetric(UErrorCode &status); 3122 3123 /** 3124 * Returns by value, unit of volume: cup-metric. 3125 * Also see {@link #createCupMetric()}. 3126 * @stable ICU 64 3127 */ 3128 static MeasureUnit getCupMetric(); 3129 3130 /** 3131 * Returns by pointer, unit of volume: deciliter. 3132 * Caller owns returned value and must free it. 3133 * Also see {@link #getDeciliter()}. 3134 * @param status ICU error code. 3135 * @stable ICU 54 3136 */ 3137 static MeasureUnit *createDeciliter(UErrorCode &status); 3138 3139 /** 3140 * Returns by value, unit of volume: deciliter. 3141 * Also see {@link #createDeciliter()}. 3142 * @stable ICU 64 3143 */ 3144 static MeasureUnit getDeciliter(); 3145 3146 /** 3147 * Returns by pointer, unit of volume: fluid-ounce. 3148 * Caller owns returned value and must free it. 3149 * Also see {@link #getFluidOunce()}. 3150 * @param status ICU error code. 3151 * @stable ICU 54 3152 */ 3153 static MeasureUnit *createFluidOunce(UErrorCode &status); 3154 3155 /** 3156 * Returns by value, unit of volume: fluid-ounce. 3157 * Also see {@link #createFluidOunce()}. 3158 * @stable ICU 64 3159 */ 3160 static MeasureUnit getFluidOunce(); 3161 3162 /** 3163 * Returns by pointer, unit of volume: fluid-ounce-imperial. 3164 * Caller owns returned value and must free it. 3165 * Also see {@link #getFluidOunceImperial()}. 3166 * @param status ICU error code. 3167 * @stable ICU 64 3168 */ 3169 static MeasureUnit *createFluidOunceImperial(UErrorCode &status); 3170 3171 /** 3172 * Returns by value, unit of volume: fluid-ounce-imperial. 3173 * Also see {@link #createFluidOunceImperial()}. 3174 * @stable ICU 64 3175 */ 3176 static MeasureUnit getFluidOunceImperial(); 3177 3178 /** 3179 * Returns by pointer, unit of volume: gallon. 3180 * Caller owns returned value and must free it. 3181 * Also see {@link #getGallon()}. 3182 * @param status ICU error code. 3183 * @stable ICU 54 3184 */ 3185 static MeasureUnit *createGallon(UErrorCode &status); 3186 3187 /** 3188 * Returns by value, unit of volume: gallon. 3189 * Also see {@link #createGallon()}. 3190 * @stable ICU 64 3191 */ 3192 static MeasureUnit getGallon(); 3193 3194 /** 3195 * Returns by pointer, unit of volume: gallon-imperial. 3196 * Caller owns returned value and must free it. 3197 * Also see {@link #getGallonImperial()}. 3198 * @param status ICU error code. 3199 * @stable ICU 57 3200 */ 3201 static MeasureUnit *createGallonImperial(UErrorCode &status); 3202 3203 /** 3204 * Returns by value, unit of volume: gallon-imperial. 3205 * Also see {@link #createGallonImperial()}. 3206 * @stable ICU 64 3207 */ 3208 static MeasureUnit getGallonImperial(); 3209 3210 /** 3211 * Returns by pointer, unit of volume: hectoliter. 3212 * Caller owns returned value and must free it. 3213 * Also see {@link #getHectoliter()}. 3214 * @param status ICU error code. 3215 * @stable ICU 54 3216 */ 3217 static MeasureUnit *createHectoliter(UErrorCode &status); 3218 3219 /** 3220 * Returns by value, unit of volume: hectoliter. 3221 * Also see {@link #createHectoliter()}. 3222 * @stable ICU 64 3223 */ 3224 static MeasureUnit getHectoliter(); 3225 3226 /** 3227 * Returns by pointer, unit of volume: liter. 3228 * Caller owns returned value and must free it. 3229 * Also see {@link #getLiter()}. 3230 * @param status ICU error code. 3231 * @stable ICU 53 3232 */ 3233 static MeasureUnit *createLiter(UErrorCode &status); 3234 3235 /** 3236 * Returns by value, unit of volume: liter. 3237 * Also see {@link #createLiter()}. 3238 * @stable ICU 64 3239 */ 3240 static MeasureUnit getLiter(); 3241 3242 /** 3243 * Returns by pointer, unit of volume: megaliter. 3244 * Caller owns returned value and must free it. 3245 * Also see {@link #getMegaliter()}. 3246 * @param status ICU error code. 3247 * @stable ICU 54 3248 */ 3249 static MeasureUnit *createMegaliter(UErrorCode &status); 3250 3251 /** 3252 * Returns by value, unit of volume: megaliter. 3253 * Also see {@link #createMegaliter()}. 3254 * @stable ICU 64 3255 */ 3256 static MeasureUnit getMegaliter(); 3257 3258 /** 3259 * Returns by pointer, unit of volume: milliliter. 3260 * Caller owns returned value and must free it. 3261 * Also see {@link #getMilliliter()}. 3262 * @param status ICU error code. 3263 * @stable ICU 54 3264 */ 3265 static MeasureUnit *createMilliliter(UErrorCode &status); 3266 3267 /** 3268 * Returns by value, unit of volume: milliliter. 3269 * Also see {@link #createMilliliter()}. 3270 * @stable ICU 64 3271 */ 3272 static MeasureUnit getMilliliter(); 3273 3274 /** 3275 * Returns by pointer, unit of volume: pint. 3276 * Caller owns returned value and must free it. 3277 * Also see {@link #getPint()}. 3278 * @param status ICU error code. 3279 * @stable ICU 54 3280 */ 3281 static MeasureUnit *createPint(UErrorCode &status); 3282 3283 /** 3284 * Returns by value, unit of volume: pint. 3285 * Also see {@link #createPint()}. 3286 * @stable ICU 64 3287 */ 3288 static MeasureUnit getPint(); 3289 3290 /** 3291 * Returns by pointer, unit of volume: pint-metric. 3292 * Caller owns returned value and must free it. 3293 * Also see {@link #getPintMetric()}. 3294 * @param status ICU error code. 3295 * @stable ICU 56 3296 */ 3297 static MeasureUnit *createPintMetric(UErrorCode &status); 3298 3299 /** 3300 * Returns by value, unit of volume: pint-metric. 3301 * Also see {@link #createPintMetric()}. 3302 * @stable ICU 64 3303 */ 3304 static MeasureUnit getPintMetric(); 3305 3306 /** 3307 * Returns by pointer, unit of volume: quart. 3308 * Caller owns returned value and must free it. 3309 * Also see {@link #getQuart()}. 3310 * @param status ICU error code. 3311 * @stable ICU 54 3312 */ 3313 static MeasureUnit *createQuart(UErrorCode &status); 3314 3315 /** 3316 * Returns by value, unit of volume: quart. 3317 * Also see {@link #createQuart()}. 3318 * @stable ICU 64 3319 */ 3320 static MeasureUnit getQuart(); 3321 3322 /** 3323 * Returns by pointer, unit of volume: tablespoon. 3324 * Caller owns returned value and must free it. 3325 * Also see {@link #getTablespoon()}. 3326 * @param status ICU error code. 3327 * @stable ICU 54 3328 */ 3329 static MeasureUnit *createTablespoon(UErrorCode &status); 3330 3331 /** 3332 * Returns by value, unit of volume: tablespoon. 3333 * Also see {@link #createTablespoon()}. 3334 * @stable ICU 64 3335 */ 3336 static MeasureUnit getTablespoon(); 3337 3338 /** 3339 * Returns by pointer, unit of volume: teaspoon. 3340 * Caller owns returned value and must free it. 3341 * Also see {@link #getTeaspoon()}. 3342 * @param status ICU error code. 3343 * @stable ICU 54 3344 */ 3345 static MeasureUnit *createTeaspoon(UErrorCode &status); 3346 3347 /** 3348 * Returns by value, unit of volume: teaspoon. 3349 * Also see {@link #createTeaspoon()}. 3350 * @stable ICU 64 3351 */ 3352 static MeasureUnit getTeaspoon(); 3353 3354 3355 // End generated createXXX methods 3356 3357 protected: 3358 3359 #ifndef U_HIDE_INTERNAL_API 3360 /** 3361 * For ICU use only. 3362 * @internal 3363 */ 3364 void initTime(const char *timeId); 3365 3366 /** 3367 * For ICU use only. 3368 * @internal 3369 */ 3370 void initCurrency(StringPiece isoCurrency); 3371 3372 /** 3373 * For ICU use only. 3374 * @internal 3375 */ 3376 void initNoUnit(const char *subtype); 3377 3378 #endif /* U_HIDE_INTERNAL_API */ 3379 3380 private: 3381 3382 // Used by new draft APIs in ICU 67. If non-null, fImpl is owned by the 3383 // MeasureUnit. 3384 MeasureUnitImpl* fImpl; 3385 3386 // An index into a static string list in measunit.cpp. If set to -1, fImpl 3387 // is in use instead of fTypeId and fSubTypeId. 3388 int16_t fSubTypeId; 3389 // An index into a static string list in measunit.cpp. If set to -1, fImpl 3390 // is in use instead of fTypeId and fSubTypeId. 3391 int8_t fTypeId; 3392 3393 MeasureUnit(int32_t typeId, int32_t subTypeId); 3394 MeasureUnit(MeasureUnitImpl&& impl); 3395 void setTo(int32_t typeId, int32_t subTypeId); 3396 int32_t getOffset() const; 3397 static MeasureUnit *create(int typeId, int subTypeId, UErrorCode &status); 3398 3399 /** 3400 * Sets output's typeId and subTypeId according to subType, if subType is a 3401 * valid/known identifier. 3402 * 3403 * @return Whether subType is known to ICU. If false, output was not 3404 * modified. 3405 */ 3406 static bool findBySubType(StringPiece subType, MeasureUnit* output); 3407 3408 friend struct MeasureUnitImpl; 3409 }; 3410 3411 U_NAMESPACE_END 3412 3413 #endif // !UNCONFIG_NO_FORMATTING 3414 3415 #endif /* U_SHOW_CPLUSPLUS_API */ 3416 3417 #endif // __MEASUREUNIT_H__
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |