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.- Author:
- sffc
- See Also:
NumberRangeFormatter- Status:
- Stable ICU 63.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FormattedNumberRangeformatRange(double first, double second)Format the given doubles to a string using the settings specified in the NumberRangeFormatter fluent setting chain.FormattedNumberRangeformatRange(int first, int second)Format the given integers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.FormattedNumberRangeformatRange(Number first, Number second)Format the given Numbers to a string using the settings specified in the NumberRangeFormatter fluent setting chain.UnlocalizedNumberRangeFormatterwithoutLocale()Disassociate the locale from this formatter.-
Methods inherited from class com.ibm.icu.number.NumberRangeFormatterSettings
collapse, equals, hashCode, identityFallback, numberFormatterBoth, numberFormatterFirst, numberFormatterSecond
-
-
-
-
Method Detail
-
formatRange
public FormattedNumberRange formatRange(int first, int second)
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:
NumberRangeFormatter- Status:
- Stable ICU 63.
-
formatRange
public FormattedNumberRange formatRange(double first, double second)
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:
NumberRangeFormatter- Status:
- Stable ICU 63.
-
formatRange
public FormattedNumberRange formatRange(Number first, Number second)
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:
NumberRangeFormatter- Status:
- Stable ICU 63.
-
withoutLocale
public UnlocalizedNumberRangeFormatter withoutLocale()
Disassociate the locale from this formatter.- Returns:
- The fluent chain.
- Status:
- Stable ICU 74.
-
-