CurrencyUnit based on the using the JDK's
Currency.
| Modifier and Type | Field and Description |
|---|---|
| private final Currency | baseCurrency
JDK currency instance. |
| private final CurrencyContext | |
| private static final long | serialVersionUID
serialVersionUID. |
| Access | Constructor and Description |
|---|---|
| pack-priv | JDKCurrencyAdapter(Currency
the Currency instance, not currency)null.Private constructor, uses a |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(CurrencyUnit
The instance to be compared with. currency)Implements java. Compares two instances, based on |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public CurrencyContext | getContext()
Implements javax. Returns the |
| public String | Returns: the currency code, nevernull. 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.Implements javax. Gets the unique currency code, the effective code depends on the currency. |
| public int | Returns: the fractional digits, from 0 to 9 (normally 0, 2 or 3), or 0 for pseudo-currencies.Implements javax. Gets the number of fractional digits typically used by this currency. |
| public int | Returns: the numeric currency codeImplements javax. Gets a numeric currency code. |
| public int | |
| public String |
| baseCurrency | back to summary |
|---|---|
| private final Currency baseCurrency JDK currency instance. | |
| context | back to summary |
|---|---|
| private final CurrencyContext context | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID serialVersionUID. | |
| JDKCurrencyAdapter | back to summary |
|---|---|
| pack-priv JDKCurrencyAdapter(Currency currency) Private constructor, uses a
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(CurrencyUnit currency) Implements java. Compares two instances, based on
| |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getContext | back to summary |
|---|---|
| public CurrencyContext getContext() Implements javax. Doc from javax. Returns the
| |
| getCurrencyCode | back to summary |
|---|---|
| public String getCurrencyCode() Implements javax. Gets the unique currency code, the effective code depends on the currency.
Since each currency is identified by this code, the currency code is
required to be defined for every For ISO codes the 3-letter ISO code should be returned. For non ISO currencies no constraints are defined.
| |
| getDefaultFractionDigits | back to summary |
|---|---|
| public int getDefaultFractionDigits() Implements javax. Gets the number of fractional digits typically used by this currency. Different currencies have different numbers of fractional digits by default. * For example, 'GBP' has 2 fractional digits, but 'JPY' has zero. * virtual currencies or those with no applicable fractional are indicated by -1. *
This method matches the API of
| |
| getNumericCode | back to summary |
|---|---|
| public int getNumericCode() Implements javax. Gets a numeric currency code. Within the ISO-4217 name space, this equals to the ISO numeric code. In other currency name spaces this number may be different, or even undefined (-1). The numeric code is an optional alternative to the standard currency code. If defined, the numeric code is required to be unique.
This method matches the API of
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Returns
| |