Coverage Report

Created: 2026-10-31 06:17

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