Class NumberStringConverter
- Direct Known Subclasses:
CurrencyStringConverter, PercentageStringConverter
A
StringConverter implementation for Number values. Instances of this class are immutable unless created with
the NumberStringConverter(NumberFormat) constructor (with a non-null argument).- Since:
- JavaFX 2.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates aNumberStringConverterthat uses a formatter/parser based on the user'sLocale.NumberStringConverter(String pattern) Creates aNumberStringConverterthat uses a formatter/parser based on the user'sLocaleand the given decimal format pattern.NumberStringConverter(NumberFormat numberFormat) Creates aNumberStringConverterthat uses the given formatter/parser.NumberStringConverter(Locale locale) Creates aNumberStringConverterthat uses a formatter/parser based on the given locale.NumberStringConverter(Locale locale, String pattern) Creates aNumberStringConverterthat uses a formatter/parser based on the givenLocaleand decimal format pattern. -
Method Summary
-
Constructor Details
-
NumberStringConverter
public NumberStringConverter()Creates aNumberStringConverterthat uses a formatter/parser based on the user'sLocale. -
NumberStringConverter
Creates aNumberStringConverterthat uses a formatter/parser based on the given locale.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.
-
NumberStringConverter
-
NumberStringConverter
Creates aNumberStringConverterthat uses a formatter/parser based on the givenLocaleand decimal format pattern.- Parameters:
locale- theLocalethat will be used by the formatter/parser. Ifnull, the user's locale will be used.pattern- the pattern describing the number format. Ifnull, a default formatter/parser will be used.- See Also:
-
NumberStringConverter
Creates aNumberStringConverterthat uses the given formatter/parser.- Parameters:
numberFormat- the formatter/parser that will be used by thetoString()andfromString()methods. Ifnull, a default formatter/parser will be used.
-
-
Method Details
-
fromString
-
toString
Converts an object to a string form. The format of the returned string is defined by the specific converter.nullis converted to an empty string, otherwise the type'stoStringis used.- Parameters:
value- the object of typeTto convert- Returns:
- a string representation of the object passed in
-