Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

How To Guides
Virtualization
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Windows
Problem Solutions
Privacy Policy

  




 

 


Eclipse Platform
Release 3.5

org.eclipse.core.databinding.conversion
Class NumberToStringConverter


java.lang.Object
  extended by 

org.eclipse.core.databinding.conversion.Converter
      extended by 
org.eclipse.core.databinding.conversion.NumberToStringConverter
All Implemented Interfaces:
IConverter

public class NumberToStringConverter
extends Converter

Converts a Number to a String using NumberFormat.format(...). This class is thread safe.

Since:
1.0

Method Summary
  Object convert ( Object fromObject)
          Converts the provided fromObject to a String.
static  NumberToStringConverter fromBigDecimal ()
           
static  NumberToStringConverter fromBigDecimal (com.ibm.icu.text.NumberFormat numberFormat)
           
static  NumberToStringConverter fromBigInteger ()
           
static  NumberToStringConverter fromBigInteger (com.ibm.icu.text.NumberFormat numberFormat)
           
static  NumberToStringConverter fromByte (boolean primitive)
           
static  NumberToStringConverter fromByte (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
static  NumberToStringConverter fromDouble (boolean primitive)
           
static  NumberToStringConverter fromDouble (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
static  NumberToStringConverter fromFloat (boolean primitive)
           
static  NumberToStringConverter fromFloat (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
static  NumberToStringConverter fromInteger (boolean primitive)
           
static  NumberToStringConverter fromInteger (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
static  NumberToStringConverter fromLong (boolean primitive)
           
static  NumberToStringConverter fromLong (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
static  NumberToStringConverter fromShort (boolean primitive)
           
static  NumberToStringConverter fromShort (com.ibm.icu.text.NumberFormat numberFormat, boolean primitive)
           
 
Methods inherited from class org.eclipse.core.databinding.conversion. Converter
getFromType, getToType
 
Methods inherited from class java.lang. Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

convert

public 
Object convert(
Object fromObject)
Converts the provided fromObject to a String. If the converter was constructed for an object type, non primitive, a fromObject of null will be converted to an empty string.

Parameters:
fromObject - value to convert. May be null 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)

fromDouble

public static 
NumberToStringConverter fromDouble(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Double converter with the provided numberFormat

fromLong

public static 
NumberToStringConverter fromLong(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Long convert with the provided numberFormat

fromFloat

public static 
NumberToStringConverter fromFloat(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Float converter with the provided numberFormat

fromInteger

public static 
NumberToStringConverter fromInteger(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Integer converter with the provided numberFormat

fromBigInteger

public static 
NumberToStringConverter fromBigInteger()
Returns:
BigInteger convert for the default locale

fromBigInteger

public static 
NumberToStringConverter fromBigInteger(com.ibm.icu.text.NumberFormat numberFormat)
Parameters:
numberFormat -
Returns:
BigInteger converter with the provided numberFormat

fromBigDecimal

public static 
NumberToStringConverter fromBigDecimal()
Returns:
BigDecimal convert for the default locale
Since:
1.2

fromBigDecimal

public static 
NumberToStringConverter fromBigDecimal(com.ibm.icu.text.NumberFormat numberFormat)
Parameters:
numberFormat -
Returns:
BigDecimal converter with the provided numberFormat
Since:
1.2

fromShort

public static 
NumberToStringConverter fromShort(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Short converter with the provided numberFormat
Since:
1.2

fromByte

public static 
NumberToStringConverter fromByte(boolean primitive)
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)
Parameters:
numberFormat -
primitive -
Returns:
Byte converter with the provided numberFormat
Since:
1.2

Eclipse Platform
Release 3.5

Guidelines for using Eclipse APIs.

Copyright (c) Eclipse contributors and others 2000, 2008. All rights reserved.


 
 
  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire