Class NumberToStringConverter
- java.lang.Object
-
- org.eclipse.core.databinding.conversion.Converter<Object,String>
-
- org.eclipse.core.internal.databinding.conversion.AbstractNumberToStringConverter
-
- org.eclipse.core.databinding.conversion.NumberToStringConverter
-
- All Implemented Interfaces:
IConverter<Object,String>
@Deprecated public class NumberToStringConverter extends org.eclipse.core.internal.databinding.conversion.AbstractNumberToStringConverter
Deprecated.UseNumberToStringConverter
instead, which does not usecom.ibm.icu
as that package may be removed in the future from platform.Converts a Number to a String usingNumberFormat.format(...)
. This class is thread safe. The first type parameter ofConverter
is set toObject
to preserve backwards compatibility, but the argument is meant to always be aNumber
.- Since:
- 1.0
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description String
convert(Object fromObject)
Deprecated.Converts the providedfromObject
to aString
.static NumberToStringConverter
fromBigDecimal()
Deprecated.static NumberToStringConverter
fromBigDecimal(com.ibm.icu.text.NumberFormat numberFormat)
Deprecated.static NumberToStringConverter
fromBigInteger()
Deprecated.static NumberToStringConverter
fromBigInteger(com.ibm.icu.text.NumberFormat numberFormat)
Deprecated.static NumberToStringConverter
fromByte(boolean primitive)
Deprecated.static NumberToStringConverter
fromByte(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.static NumberToStringConverter
fromDouble(boolean primitive)
Deprecated.static NumberToStringConverter
fromDouble(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.static NumberToStringConverter
fromFloat(boolean primitive)
Deprecated.static NumberToStringConverter
fromFloat(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.static NumberToStringConverter
fromInteger(boolean primitive)
Deprecated.static NumberToStringConverter
fromInteger(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.static NumberToStringConverter
fromLong(boolean primitive)
Deprecated.static NumberToStringConverter
fromLong(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.static NumberToStringConverter
fromShort(boolean primitive)
Deprecated.static NumberToStringConverter
fromShort(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.-
Methods inherited from class org.eclipse.core.databinding.conversion.Converter
getFromType, getToType
-
-
-
-
Method Detail
-
convert
public String convert(Object fromObject)
Deprecated.Description copied from class:org.eclipse.core.internal.databinding.conversion.AbstractNumberToStringConverter
Converts the providedfromObject
to aString
. If the converter was constructed for an object type, non primitive, afromObject
ofnull
will be converted to an empty string.- Specified by:
convert
in interfaceIConverter<Object,String>
- Overrides:
convert
in classorg.eclipse.core.internal.databinding.conversion.AbstractNumberToStringConverter
- Parameters:
fromObject
- value to convert. May benull
if the converter was constructed for a non primitive type.- Returns:
- the converted object, of type
IConverter.getToType()
- See Also:
IConverter.convert(java.lang.Object)
- Implementation Note:
- Overridden to avoid API tooling problem.
-
fromDouble
public static NumberToStringConverter fromDouble(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a double- Returns:
- Double converter for the default locale
-
fromDouble
public static NumberToStringConverter fromDouble(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a double- Returns:
- Double converter with the provided numberFormat
-
fromLong
public static NumberToStringConverter fromLong(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a long- Returns:
- Long converter for the default locale
-
fromLong
public static NumberToStringConverter fromLong(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a long- Returns:
- Long convert with the provided numberFormat
-
fromFloat
public static NumberToStringConverter fromFloat(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a float- Returns:
- Float converter for the default locale
-
fromFloat
public static NumberToStringConverter fromFloat(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a float- Returns:
- Float converter with the provided numberFormat
-
fromInteger
public static NumberToStringConverter fromInteger(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a int- Returns:
- Integer converter for the default locale
-
fromInteger
public static NumberToStringConverter fromInteger(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a int- Returns:
- Integer converter with the provided numberFormat
-
fromBigInteger
public static NumberToStringConverter fromBigInteger()
Deprecated.- Returns:
- BigInteger convert for the default locale
-
fromBigInteger
public static NumberToStringConverter fromBigInteger(com.ibm.icu.text.NumberFormat numberFormat)
Deprecated.- Parameters:
numberFormat
- number format used by the converter- Returns:
- BigInteger converter with the provided numberFormat
-
fromBigDecimal
public static NumberToStringConverter fromBigDecimal()
Deprecated.- Returns:
- BigDecimal convert for the default locale
- Since:
- 1.2
-
fromBigDecimal
public static NumberToStringConverter fromBigDecimal(com.ibm.icu.text.NumberFormat numberFormat)
Deprecated.- Parameters:
numberFormat
- number format used by the converter- Returns:
- BigDecimal converter with the provided numberFormat
- Since:
- 1.2
-
fromShort
public static NumberToStringConverter fromShort(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a short- Returns:
- Short converter for the default locale
- Since:
- 1.2
-
fromShort
public static NumberToStringConverter fromShort(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a short- Returns:
- Short converter with the provided numberFormat
- Since:
- 1.2
-
fromByte
public static NumberToStringConverter fromByte(boolean primitive)
Deprecated.- Parameters:
primitive
-true
if the type is a byte- Returns:
- Byte converter for the default locale
- Since:
- 1.2
-
fromByte
public static NumberToStringConverter fromByte(com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
Deprecated.- Parameters:
numberFormat
- number format used by the converterprimitive
-true
if the type is a byte- Returns:
- Byte converter with the provided numberFormat
- Since:
- 1.2
-
-