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