APIdia Launch Partner
Top Description Fields Constructors Methods
javafx.util.converter

public Class NumberStringConverter

extends StringConverter<Number>
Class Inheritance
Known Direct Subclasses
javafx.util.converter.PercentageStringConverter, javafx.util.converter.CurrencyStringConverter
Imports
java.text.DecimalFormat, .DecimalFormatSymbols, .NumberFormat, .ParseException, java.util.Locale, javafx.util.StringConverter

A StringConverter implementation for Number values. Instances of this class are immutable.
Since
JavaFX 2.1

Field Summary

Modifier and TypeField and Description
pack-priv final Locale
pack-priv final NumberFormat
pack-priv final String

Constructor Summary

AccessConstructor and Description
public
NumberStringConverter()

Constructs a NumberStringConverter with the default locale and format.

public
NumberStringConverter(Locale
the locale used in determining the number format used to format the string
locale
)

Constructs a NumberStringConverter with the given locale and the default format.

public
NumberStringConverter(String
the string pattern used in determining the number format used to format the string
pattern
)

Constructs a NumberStringConverter with the default locale and the given decimal format pattern.

public
NumberStringConverter(Locale
the locale used in determining the number format used to format the string
locale
,
String
the string pattern used in determining the number format used to format the string
pattern
)

Constructs a NumberStringConverter with the given locale and decimal format pattern.

public
NumberStringConverter(NumberFormat
the number format used to format the string
numberFormat
)

Constructs a NumberStringConverter with the given number format.

pack-priv
NumberStringConverter(Locale locale, String pattern, NumberFormat numberFormat)

Method Summary

Modifier and TypeMethod and Description
public Number
fromString(String value)

Implements abstract javafx.util.StringConverter.fromString.

Converts the string provided into an object defined by the specific converter.

protected NumberFormat

Returns:

a NumberFormat instance for formatting and parsing in this StringConverter
getNumberFormat
()
Deprecated for removal since 22. This method was exposed erroneously and will be removed in a future version.

Returns a NumberFormat instance to use for formatting and parsing in this StringConverter.

public String
toString(Number value)

Implements abstract javafx.util.StringConverter.toString.

Converts the object provided into its string form.

Field Detail

localeback to summary
pack-priv final Locale locale
numberFormatback to summary
pack-priv final NumberFormat numberFormat
patternback to summary
pack-priv final String pattern

Constructor Detail

NumberStringConverterback to summary
public NumberStringConverter()

Constructs a NumberStringConverter with the default locale and format.

NumberStringConverterback to summary
public NumberStringConverter(Locale locale)

Constructs a NumberStringConverter with the given locale and the default format.

Parameters
locale:Locale

the locale used in determining the number format used to format the string

NumberStringConverterback to summary
public NumberStringConverter(String pattern)

Constructs a NumberStringConverter with the default locale and the given decimal format pattern.

Parameters
pattern:String

the string pattern used in determining the number format used to format the string

See Also
java.text.DecimalFormat
NumberStringConverterback to summary
public NumberStringConverter(Locale locale, String pattern)

Constructs a NumberStringConverter with the given locale and decimal format pattern.

Parameters
locale:Locale

the locale used in determining the number format used to format the string

pattern:String

the string pattern used in determining the number format used to format the string

See Also
java.text.DecimalFormat
NumberStringConverterback to summary
public NumberStringConverter(NumberFormat numberFormat)

Constructs a NumberStringConverter with the given number format.

Parameters
numberFormat:NumberFormat

the number format used to format the string

NumberStringConverterback to summary
pack-priv NumberStringConverter(Locale locale, String pattern, NumberFormat numberFormat)

Method Detail

fromStringback to summary
public Number fromString(String value)

Implements abstract javafx.util.StringConverter.fromString.

Doc from javafx.util.StringConverter.fromString.

Converts the string provided into an object defined by the specific converter. Format of the string and type of the resulting object is defined by the specific converter.

Annotations
@Override
getNumberFormatback to summary
protected NumberFormat getNumberFormat()

Deprecated

for removal since 22.

This method was exposed erroneously and will be removed in a future version.

Returns a NumberFormat instance to use for formatting and parsing in this StringConverter.

Returns:NumberFormat

a NumberFormat instance for formatting and parsing in this StringConverter

Annotations
@Deprecated
forRemoval:true
since:22
toStringback to summary
public String toString(Number value)

Implements abstract javafx.util.StringConverter.toString.

Doc from javafx.util.StringConverter.toString.

Converts the object provided into its string form. Format of the returned string is defined by the specific converter.

Annotations
@Override