Package com.ibm.icu.number
Enum NumberRangeFormatter.RangeIdentityFallback
- java.lang.Object
-
- java.lang.Enum<NumberRangeFormatter.RangeIdentityFallback>
-
- com.ibm.icu.number.NumberRangeFormatter.RangeIdentityFallback
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<NumberRangeFormatter.RangeIdentityFallback>
- Enclosing class:
- NumberRangeFormatter
public static enum NumberRangeFormatter.RangeIdentityFallback extends java.lang.Enum<NumberRangeFormatter.RangeIdentityFallback>
Defines the behavior when the two numbers in the range are identical after rounding. To programmatically detect when the identity fallback is used, compare the lower and upper BigDecimals via FormattedNumber.- See Also:
NumberRangeFormatter
-
-
Enum Constant Summary
Enum Constants Enum Constant Description APPROXIMATELY
Show the number using a locale-sensitive approximation pattern.APPROXIMATELY_OR_SINGLE_VALUE
Show the number using a locale-sensitive approximation pattern.RANGE
Show the number as the range of two equal values.SINGLE_VALUE
Show the number as a single value rather than a range.
-
Constructor Summary
Constructors Modifier Constructor Description private
RangeIdentityFallback()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static NumberRangeFormatter.RangeIdentityFallback
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static NumberRangeFormatter.RangeIdentityFallback[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SINGLE_VALUE
public static final NumberRangeFormatter.RangeIdentityFallback SINGLE_VALUE
Show the number as a single value rather than a range. Example: "$5"- See Also:
NumberRangeFormatter
-
APPROXIMATELY_OR_SINGLE_VALUE
public static final NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY_OR_SINGLE_VALUE
Show the number using a locale-sensitive approximation pattern. If the numbers were the same before rounding, show the single value. Example: "~$5" or "$5"- See Also:
NumberRangeFormatter
-
APPROXIMATELY
public static final NumberRangeFormatter.RangeIdentityFallback APPROXIMATELY
Show the number using a locale-sensitive approximation pattern. Use the range pattern always, even if the inputs are the same. Example: "~$5"- See Also:
NumberRangeFormatter
-
RANGE
public static final NumberRangeFormatter.RangeIdentityFallback RANGE
Show the number as the range of two equal values. Use the range pattern always, even if the inputs are the same. Example (with RangeCollapse.NONE): "$5 – $5"- See Also:
NumberRangeFormatter
-
-
Method Detail
-
values
public static NumberRangeFormatter.RangeIdentityFallback[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (NumberRangeFormatter.RangeIdentityFallback c : NumberRangeFormatter.RangeIdentityFallback.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static NumberRangeFormatter.RangeIdentityFallback valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-