Debian Codegraph @

intl/icu/source/i18n/unicode/measunit.h

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