javax.money.CurrencyUnit that allows to of new
instances using a fluent API. Instances created also can be added to the
ConfigurableCurrencyUnitProvider
singleton, which publishes the instances, so they are visible from the
javax.money.Monetary singleton.
| Modifier and Type | Field and Description |
|---|---|
| private String | currencyCode
The unique currency code. |
| private CurrencyContext | currencyContext
THe currency's context. |
| private int | defaultFractionDigits
The default fraction digits. |
| private int | numericCode
The (optional) numeric code. |
| private static final long | serialVersionUID
serialVersionUID. |
| Access | Constructor and Description |
|---|---|
| pack-priv | BuildableCurrencyUnit(CurrencyUnitBuilder
the builder, never null. builder)Constructor, called from the Builder. |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(CurrencyUnit o)
Implements java. Compares this object with the specified object for order. |
| 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 | getCurrencyCode()
Implements javax. Gets the unique currency code, the effective code depends on the currency. |
| public int | getDefaultFractionDigits()
Implements javax. Gets the number of fractional digits typically used by this currency. |
| public int | |
| public int | |
| public String |
| currencyCode | back to summary |
|---|---|
| private String currencyCode The unique currency code. | |
| currencyContext | back to summary |
|---|---|
| private CurrencyContext currencyContext THe currency's context. | |
| defaultFractionDigits | back to summary |
|---|---|
| private int defaultFractionDigits The default fraction digits. | |
| numericCode | back to summary |
|---|---|
| private int numericCode The (optional) numeric code. | |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID serialVersionUID. | |
| BuildableCurrencyUnit | back to summary |
|---|---|
| pack-priv BuildableCurrencyUnit(CurrencyUnitBuilder builder) Constructor, called from the Builder.
| |
| compareTo | back to summary |
|---|---|
| public int compareTo(CurrencyUnit o) Implements java. Doc from java. Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. The implementor must ensure The implementor must also ensure that the relation is transitive:
Finally, the implementor must ensure that
| |
| 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. Doc from 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. Doc from 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. Doc from 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. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |