* If there is no good match, then the matcher will return null for the
* best supported locale.
*
- * @draft ICU 68
+ * @stable ICU 68
*/
public Builder setNoDefaultLocale() {
this.defaultLocale = null;
* @param desired the desired locale for distance comparison.
* @param supported the supported locale for distance comparison.
* @return this Builder object
- * @draft ICU 68
+ * @stable ICU 68
*/
public Builder setMaxDistance(Locale desired, Locale supported) {
if (desired == null || supported == null) {
* @param desired the desired locale for distance comparison.
* @param supported the supported locale for distance comparison.
* @return this Builder object
- * @draft ICU 68
+ * @stable ICU 68
*/
public Builder setMaxDistance(ULocale desired, ULocale supported) {
if (desired == null || supported == null) {
* @param desired The desired locale.
* @param supported The supported locale.
* @return true if the pair of locales matches acceptably.
- * @draft ICU 68
+ * @stable ICU 68
*/
public boolean isMatch(Locale desired, Locale supported) {
int indexAndDistance = LocaleDistance.INSTANCE.getBestIndexAndDistance(
* @param desired The desired locale.
* @param supported The supported locale.
* @return true if the pair of locales matches acceptably.
- * @draft ICU 68
+ * @stable ICU 68
*/
public boolean isMatch(ULocale desired, ULocale supported) {
int indexAndDistance = LocaleDistance.INSTANCE.getBestIndexAndDistance(
* The complexity determines which operations are available. For example, you cannot set the power
* or prefix of a compound unit.
*
- * @draft ICU 68
+ * @stable ICU 68
*/
public enum Complexity {
/**
* A single unit, like kilojoule.
*
- * @draft ICU 68
+ * @stable ICU 68
*/
SINGLE,
/**
* A compound unit, like meter-per-second.
*
- * @draft ICU 68
+ * @stable ICU 68
*/
COMPOUND,
/**
* A mixed unit, like hour-and-minute.
*
- * @draft ICU 68
+ * @stable ICU 68
*/
MIXED
}
/**
* SI prefix: yotta, 10^24.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
YOTTA(24, "yotta", 10),
/**
* SI prefix: zetta, 10^21.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
ZETTA(21, "zetta", 10),
/**
* SI prefix: exa, 10^18.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
EXA(18, "exa", 10),
/**
* SI prefix: peta, 10^15.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
PETA(15, "peta", 10),
/**
* SI prefix: tera, 10^12.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
TERA(12, "tera", 10),
/**
* SI prefix: giga, 10^9.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
GIGA(9, "giga", 10),
/**
* SI prefix: mega, 10^6.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
MEGA(6, "mega", 10),
/**
* SI prefix: kilo, 10^3.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
KILO(3, "kilo", 10),
/**
* SI prefix: hecto, 10^2.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
HECTO(2, "hecto", 10),
/**
* SI prefix: deka, 10^1.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
DEKA(1, "deka", 10),
/**
* The absence of an SI prefix.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
ONE(0, "", 10),
/**
* SI prefix: deci, 10^-1.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
DECI(-1, "deci", 10),
/**
* SI prefix: centi, 10^-2.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
CENTI(-2, "centi", 10),
/**
* SI prefix: milli, 10^-3.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
MILLI(-3, "milli", 10),
/**
* SI prefix: micro, 10^-6.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
MICRO(-6, "micro", 10),
/**
* SI prefix: nano, 10^-9.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
NANO(-9, "nano", 10),
/**
* SI prefix: pico, 10^-12.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
PICO(-12, "pico", 10),
/**
* SI prefix: femto, 10^-15.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
FEMTO(-15, "femto", 10),
/**
* SI prefix: atto, 10^-18.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
ATTO(-18, "atto", 10),
/**
* SI prefix: zepto, 10^-21.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
ZEPTO(-21, "zepto", 10),
/**
* SI prefix: yocto, 10^-24.
*
- * @draft ICU 68
+ * @draft ICU 69
*/
YOCTO(-24, "yocto", 10),
*
* @param identifier CLDR Unit Identifier
* @throws IllegalArgumentException if the identifier is invalid.
- * @draft ICU 68
+ * @stable ICU 68
*/
public static MeasureUnit forIdentifier(String identifier) {
if (identifier == null || identifier.isEmpty()) {
* Get CLDR Unit Identifier for this MeasureUnit, as defined in UTS 35.
*
* @return The string form of this unit.
- * @draft ICU 68
+ * @stable ICU 68
*/
public String getIdentifier() {
String result = measureUnitImpl == null ? getSubtype() : measureUnitImpl.getIdentifier();
* Compute the complexity of the unit. See Complexity for more information.
*
* @return The unit complexity.
- * @draft ICU 68
+ * @stable ICU 68
*/
public Complexity getComplexity() {
if (measureUnitImpl == null) {
*
* @return The dimensionality (power) of this simple unit.
* @throws UnsupportedOperationException if the unit is COMPOUND or MIXED.
- * @draft ICU 68
+ * @stable ICU 68
*/
public int getDimensionality() {
return getSingleUnitImpl().getDimensionality();
* @param dimensionality The dimensionality (power).
* @return A new SINGLE unit.
* @throws UnsupportedOperationException if the unit is COMPOUND or MIXED.
- * @draft ICU 68
+ * @stable ICU 68
*/
public MeasureUnit withDimensionality(int dimensionality) {
SingleUnitImpl singleUnit = getSingleUnitImpl();
*
* @return The reciprocal of the target unit.
* @throws UnsupportedOperationException if the unit is MIXED.
- * @draft ICU 68
+ * @stable ICU 68
*/
public MeasureUnit reciprocal() {
MeasureUnitImpl measureUnit = getCopyOfMeasureUnitImpl();
* @param other The MeasureUnit to multiply with the target.
* @return The product of the target unit with the provided unit.
* @throws UnsupportedOperationException if the unit is MIXED.
- * @draft ICU 68
+ * @stable ICU 68
*/
public MeasureUnit product(MeasureUnit other) {
MeasureUnitImpl implCopy = getCopyOfMeasureUnitImpl();
* If this is a SINGLE unit, a list of length 1 will be returned.
*
* @return An unmodifiable list of single units
- * @draft ICU 68
+ * @stable ICU 68
*/
public List<MeasureUnit> splitToSingleUnits() {
final ArrayList<SingleUnitImpl> singleUnits =
/**
* Constant for unit of graphics: dot
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit DOT = MeasureUnit.internalGetInstance("graphics", "dot");
/**
* Constant for unit of length: earth-radius
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit EARTH_RADIUS = MeasureUnit.internalGetInstance("length", "earth-radius");
/**
* Constant for unit of light: candela
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit CANDELA = MeasureUnit.internalGetInstance("light", "candela");
/**
* Constant for unit of light: lumen
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit LUMEN = MeasureUnit.internalGetInstance("light", "lumen");
/**
* Constant for unit of mass: grain
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit GRAIN = MeasureUnit.internalGetInstance("mass", "grain");
/**
* Constant for unit of volume: dessert-spoon
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit DESSERT_SPOON = MeasureUnit.internalGetInstance("volume", "dessert-spoon");
/**
* Constant for unit of volume: dessert-spoon-imperial
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit DESSERT_SPOON_IMPERIAL = MeasureUnit.internalGetInstance("volume", "dessert-spoon-imperial");
/**
* Constant for unit of volume: dram
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit DRAM = MeasureUnit.internalGetInstance("volume", "dram");
/**
* Constant for unit of volume: drop
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit DROP = MeasureUnit.internalGetInstance("volume", "drop");
/**
* Constant for unit of volume: jigger
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit JIGGER = MeasureUnit.internalGetInstance("volume", "jigger");
/**
* Constant for unit of volume: pinch
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit PINCH = MeasureUnit.internalGetInstance("volume", "pinch");
/**
* Constant for unit of volume: quart-imperial
- * @draft ICU 68
+ * @stable ICU 68
*/
public static final MeasureUnit QUART_IMPERIAL = MeasureUnit.internalGetInstance("volume", "quart-imperial");