public final class JDKCurrencyAdapter extends Object implements CurrencyUnit, Serializable, Comparable<CurrencyUnit>
CurrencyUnit based on the using the JDK's
Currency.| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(CurrencyUnit currency)
Compares two instances, based on
getCurrencyCode(). |
boolean |
equals(Object obj) |
CurrencyContext |
getContext() |
String |
getCurrencyCode()
Gets the unique currency code, the effective code depends on the
currency.
|
int |
getDefaultFractionDigits()
Gets the number of fractional digits typically used by this currency.
|
int |
getNumericCode()
Gets a numeric currency code.
|
int |
hashCode() |
String |
toString()
Returns
getCurrencyCode() |
public String getCurrencyCode()
CurrencyUnit and not
null or empty.
For ISO codes the 3-letter ISO code should be returned. For non ISO
currencies no constraints are defined.getCurrencyCode in interface CurrencyUnitnull. For ISO-4217 this this
will be the three letter ISO-4217 code. However, alternate
currencies can have different codes. Also there is no constraint
about the formatting of alternate codes, despite they fact that
the currency codes must be unique.CurrencyUnit.getCurrencyCode()public int getNumericCode()
Currency.getNumericCode in interface CurrencyUnitCurrencyUnit.getNumericCode()public int getDefaultFractionDigits()
Currency.getDefaultFractionDigits in interface CurrencyUnitpublic CurrencyContext getContext()
getContext in interface CurrencyUnitpublic int compareTo(CurrencyUnit currency)
getCurrencyCode().compareTo in interface Comparable<CurrencyUnit>currency - The instance to be compared with.Comparable.compareTo(java.lang.Object)public String toString()
getCurrencyCode()toString in class ObjectObject.toString()Copyright © 2012–2020 JavaMoney. All rights reserved.