Package com.ibm.icu.number
Class LocalizedNumberRangeFormatter
java.lang.Object
com.ibm.icu.number.NumberRangeFormatterSettings<LocalizedNumberRangeFormatter>
com.ibm.icu.number.LocalizedNumberRangeFormatter
public class LocalizedNumberRangeFormatter
extends NumberRangeFormatterSettings<LocalizedNumberRangeFormatter>
A NumberRangeFormatter that has a locale associated with it; this means .formatRange() methods are available.
Instances of this class are immutable and thread-safe.
- See Also:
-
Field Summary
FieldsFields inherited from class com.ibm.icu.number.NumberRangeFormatterSettings
KEY_COLLAPSE, KEY_FORMATTER_1, KEY_FORMATTER_2, KEY_IDENTITY_FALLBACK, KEY_LOCALE, KEY_MACROS, KEY_MAX, KEY_SAME_FORMATTERS
-
Constructor Summary
ConstructorsConstructorDescriptionLocalizedNumberRangeFormatter
(NumberRangeFormatterSettings<?> parent, int key, Object value) -
Method Summary
Modifier and TypeMethodDescription(package private) LocalizedNumberRangeFormatter
(package private) FormattedNumberRange
formatImpl
(DecimalQuantity first, DecimalQuantity second, boolean equalBeforeRounding) formatRange
(double first, double second) Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain.formatRange
(int first, int second) Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.formatRange
(Number first, Number second) Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.Disassociate the locale from this formatter.Methods inherited from class com.ibm.icu.number.NumberRangeFormatterSettings
collapse, equals, hashCode, identityFallback, numberFormatterBoth, numberFormatterFirst, numberFormatterSecond, resolve
-
Field Details
-
fImpl
-
-
Constructor Details
-
LocalizedNumberRangeFormatter
LocalizedNumberRangeFormatter(NumberRangeFormatterSettings<?> parent, int key, Object value)
-
-
Method Details
-
formatRange
Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.- Parameters:
first
- The first number in the range, usually to the left in LTR locales.second
- The second number in the range, usually to the right in LTR locales.- Returns:
- A FormattedNumberRange object; call .toString() to get the string.
- See Also:
-
formatRange
Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain.- Parameters:
first
- The first number in the range, usually to the left in LTR locales.second
- The second number in the range, usually to the right in LTR locales.- Returns:
- A FormattedNumberRange object; call .toString() to get the string.
- See Also:
-
formatRange
Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.- Parameters:
first
- The first number in the range, usually to the left in LTR locales.second
- The second number in the range, usually to the right in LTR locales.- Returns:
- A FormattedNumberRange object; call .toString() to get the string.
- Throws:
IllegalArgumentException
- if first or second is null- See Also:
-
withoutLocale
Disassociate the locale from this formatter.- Returns:
- The fluent chain.
-
formatImpl
FormattedNumberRange formatImpl(DecimalQuantity first, DecimalQuantity second, boolean equalBeforeRounding) -
create
- Specified by:
create
in classNumberRangeFormatterSettings<LocalizedNumberRangeFormatter>
-