Package com.google.gwt.i18n.client
Class DefaultCurrencyData
java.lang.Object
com.google.gwt.i18n.client.DefaultCurrencyData
- All Implemented Interfaces:
CurrencyData
A default
CurrencyData implementation, so new methods can be added
to the interface without breaking implementors if a reasonable default is
available.-
Constructor Summary
ConstructorsConstructorDescriptionDefaultCurrencyData(String currencyCode, String currencySymbol) Create a default defaultCurrencyDatainstance, returningfalsefor allisFoomethods, having 2 fractional digits by default, and using the standard symbol for the portable symbol.DefaultCurrencyData(String currencyCode, String currencySymbol, int fractionDigits) Create a default defaultCurrencyDatainstance, returningfalsefor allisFoomethods and using the standard symbol for the portable symbol. -
Method Summary
Modifier and TypeMethodDescriptionReturns the ISO4217 code for this currency.Returns the default symbol to use for this currency.intReturns the default number of decimal positions for this currency.Returns the default symbol to use for this currency, intended to be recognizable in most locales.Returns the simplest symbol to use for this currency, which is not guaranteed to be unique -- for example, this might return "$" for both USD and CAD.booleanReturns true if this currency is deprecated and should not be returned by default in currency lists.booleanReturns true if there should always be a space between the currency symbol and the number, false if there should be no space.booleanReturns true if the spacing between the currency symbol and the number is fixed regardless of locale defaults.booleanReturns true if the position of the currency symbol relative to the number is fixed regardless of locale defaults.booleanReturns true if the currency symbol should go before the number, false if it should go after the number.
-
Constructor Details
-
DefaultCurrencyData
Create a default defaultCurrencyDatainstance, returningfalsefor allisFoomethods, having 2 fractional digits by default, and using the standard symbol for the portable symbol.- Parameters:
currencyCode- ISO 4217 currency codecurrencySymbol- symbol to use for this currency
-
DefaultCurrencyData
Create a default defaultCurrencyDatainstance, returningfalsefor allisFoomethods and using the standard symbol for the portable symbol.- Parameters:
currencyCode- ISO 4217 currency codecurrencySymbol- symbol to use for this currencyfractionDigits- default number of fraction digits
-
-
Method Details
-
getCurrencyCode
Description copied from interface:CurrencyDataReturns the ISO4217 code for this currency.- Specified by:
getCurrencyCodein interfaceCurrencyData
-
getCurrencySymbol
Description copied from interface:CurrencyDataReturns the default symbol to use for this currency.- Specified by:
getCurrencySymbolin interfaceCurrencyData
-
getDefaultFractionDigits
public int getDefaultFractionDigits()Description copied from interface:CurrencyDataReturns the default number of decimal positions for this currency.- Specified by:
getDefaultFractionDigitsin interfaceCurrencyData
-
getPortableCurrencySymbol
Description copied from interface:CurrencyDataReturns the default symbol to use for this currency, intended to be recognizable in most locales. If such a symbol is not available, it is acceptable to return the same value asCurrencyData.getCurrencySymbol().- Specified by:
getPortableCurrencySymbolin interfaceCurrencyData
-
getSimpleCurrencySymbol
Description copied from interface:CurrencyDataReturns the simplest symbol to use for this currency, which is not guaranteed to be unique -- for example, this might return "$" for both USD and CAD. It is acceptable to return the same value asCurrencyData.getCurrencySymbol().- Specified by:
getSimpleCurrencySymbolin interfaceCurrencyData
-
isDeprecated
public boolean isDeprecated()Description copied from interface:CurrencyDataReturns true if this currency is deprecated and should not be returned by default in currency lists.- Specified by:
isDeprecatedin interfaceCurrencyData
-
isSpaceForced
public boolean isSpaceForced()Description copied from interface:CurrencyDataReturns true if there should always be a space between the currency symbol and the number, false if there should be no space. Ignored unlessCurrencyData.isSpacingFixed()returns true.- Specified by:
isSpaceForcedin interfaceCurrencyData
-
isSpacingFixed
public boolean isSpacingFixed()Description copied from interface:CurrencyDataReturns true if the spacing between the currency symbol and the number is fixed regardless of locale defaults. In this case, spacing will be determined byCurrencyData.isSpaceForced().- Specified by:
isSpacingFixedin interfaceCurrencyData
-
isSymbolPositionFixed
public boolean isSymbolPositionFixed()Description copied from interface:CurrencyDataReturns true if the position of the currency symbol relative to the number is fixed regardless of locale defaults. In this case, the position will be determined byCurrencyData.isSymbolPrefix().- Specified by:
isSymbolPositionFixedin interfaceCurrencyData
-
isSymbolPrefix
public boolean isSymbolPrefix()Description copied from interface:CurrencyDataReturns true if the currency symbol should go before the number, false if it should go after the number. This is ignored unlessCurrencyData.isSymbolPositionFixed()is true.- Specified by:
isSymbolPrefixin interfaceCurrencyData
-