Coverage Report

Created: 2026-06-23 06:26

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