- java.lang.Object
-
- javafx.util.StringConverter<Number>
-
- javafx.util.converter.NumberStringConverter
-
- javafx.util.converter.CurrencyStringConverter
-
public class CurrencyStringConverter extends NumberStringConverter
AStringConverter
implementation forNumber
values that represent currency. Instances of this class are immutable.- Since:
- JavaFX 2.1
- See Also:
PercentageStringConverter
,NumberStringConverter
,StringConverter
-
-
Constructor Summary
Constructors Constructor Description CurrencyStringConverter()
Constructs aCurrencyStringConverter
with the default locale and format.CurrencyStringConverter(String pattern)
Constructs aCurrencyStringConverter
with the default locale and the given decimal format pattern.CurrencyStringConverter(NumberFormat numberFormat)
Constructs aCurrencyStringConverter
with the given number format.CurrencyStringConverter(Locale locale)
Constructs aCurrencyStringConverter
with the given locale and the default format.CurrencyStringConverter(Locale locale, String pattern)
Constructs aCurrencyStringConverter
with the given locale and decimal format pattern.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected NumberFormat
getNumberFormat()
Returns aNumberFormat
instance to use for formatting and parsing in thisStringConverter
.-
Methods inherited from class javafx.util.converter.NumberStringConverter
fromString, toString
-
-
-
-
Constructor Detail
-
CurrencyStringConverter
public CurrencyStringConverter()
Constructs aCurrencyStringConverter
with the default locale and format.
-
CurrencyStringConverter
public CurrencyStringConverter(Locale locale)
Constructs aCurrencyStringConverter
with the given locale and the default format.- Parameters:
locale
- the locale used in determining the number format used to format the string
-
CurrencyStringConverter
public CurrencyStringConverter(String pattern)
Constructs aCurrencyStringConverter
with the default locale and the given decimal format pattern.- Parameters:
pattern
- the string pattern used in determining the number format used to format the string- See Also:
DecimalFormat
-
CurrencyStringConverter
public CurrencyStringConverter(Locale locale, String pattern)
Constructs aCurrencyStringConverter
with the given locale and decimal format pattern.- Parameters:
locale
- the locale used in determining the number format used to format the stringpattern
- the string pattern used in determining the number format used to format the string- See Also:
DecimalFormat
-
CurrencyStringConverter
public CurrencyStringConverter(NumberFormat numberFormat)
Constructs aCurrencyStringConverter
with the given number format.- Parameters:
numberFormat
- the number format used to format the string
-
-
Method Detail
-
getNumberFormat
protected NumberFormat getNumberFormat()
Returns aNumberFormat
instance to use for formatting and parsing in thisStringConverter
.- Overrides:
getNumberFormat
in classNumberStringConverter
- Returns:
- a
NumberFormat
instance for formatting and parsing in thisStringConverter
-
-