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