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