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