DecimalFormat as formatter.
| Modifier and Type | Field and Description |
|---|---|
| private static final AmountFormatContext | |
| private final CurrencyUnit | |
| private final DecimalFormat | |
| private static final MonetaryAmountFormat | |
| private final MonetaryAmountProducer | |
| pack-priv static final String |
| Access | Constructor and Description |
|---|---|
| public | MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit)
|
| Modifier and Type | Method and Description |
|---|---|
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public AmountFormatContext | getContext()
Implements javax. The |
| pack-priv CurrencyUnit | |
| pack-priv DecimalFormat | |
| pack-priv MonetaryAmountProducer | |
| public int | |
| public static MonetaryAmountFormat | |
| public MonetaryAmount | parse(CharSequence text)
Implements javax. Fully parses the text into an instance of |
| public void | print(Appendable appendable, MonetaryAmount amount)
Implements javax. Formats the given |
| public String | queryFrom(MonetaryAmount amount)
Implements javax. Queries the specified monetary amount. |
| public String | |
| public String | |
| public String |
| CONTEXT | back to summary |
|---|---|
| private static final AmountFormatContext CONTEXT | |
| currencyUnit | back to summary |
|---|---|
| private final CurrencyUnit currencyUnit | |
| decimalFormat | back to summary |
|---|---|
| private final DecimalFormat decimalFormat | |
| DEFAULT_INSTANCE | back to summary |
|---|---|
| private static final MonetaryAmountFormat DEFAULT_INSTANCE | |
| producer | back to summary |
|---|---|
| private final MonetaryAmountProducer producer | |
| STYLE | back to summary |
|---|---|
| pack-priv static final String STYLE | |
| MonetaryAmountDecimalFormat | back to summary |
|---|---|
| public MonetaryAmountDecimalFormat(DecimalFormat decimalFormat, MonetaryAmountProducer producer, CurrencyUnit currencyUnit) | |
| 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 AmountFormatContext getContext() Implements javax. Doc from javax. The
| |
| getCurrencyUnit | back to summary |
|---|---|
| pack-priv CurrencyUnit getCurrencyUnit() | |
| getDecimalFormat | back to summary |
|---|---|
| pack-priv DecimalFormat getDecimalFormat() | |
| getProducer | back to summary |
|---|---|
| pack-priv MonetaryAmountProducer getProducer() | |
| 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
| |
| of | back to summary |
|---|---|
| public static MonetaryAmountFormat of() Get the default formatter based on the current default locale. | |
| parse | back to summary |
|---|---|
| public MonetaryAmount parse(CharSequence text) throws MonetaryParseException Implements javax. Doc from javax. Fully parses the text into an instance of The parse must complete normally and parse the entire text. If the parse completes without reading the entire length of the text, an exception is thrown. If any other problem occurs during parsing, an exception is thrown.
Additionally the effective implementation type returned can be determined by the
| |
| back to summary | |
|---|---|
| public void print(Appendable appendable, MonetaryAmount amount) throws IOException Implements javax. Doc from javax. Formats the given
Example implementations of
| |
| queryFrom | back to summary |
|---|---|
| public String queryFrom(MonetaryAmount amount) Implements javax. Doc from javax. Queries the specified monetary amount. This queries the specified monetary amount to return an object using the logic encapsulated in the implementing class. Examples might be a query that checks if the amount is positive, or one that extracts the currency as a symbol.
There are two equivalent ways of using a // these two lines are equivalent, but the second approach is recommended monetary = thisQuery.queryFrom(monetary); monetary = monetary.query(thisQuery);It is recommended to use the second approach, query(MonetaryQuery), as it is a lot clearer to read in code.
Implementation specificationThe implementation must take the input object and query it. The implementation defines the logic of the query and is responsible for documenting that logic. It may use any method onMonetaryAmount
to determine the result. The input object must not be altered.
This method may be called from multiple threads in parallel. It must be thread-safe when invoked.
| |
| toLocalizedPattern | back to summary |
|---|---|
| public String toLocalizedPattern() | |
| toPattern | back to summary |
|---|---|
| public String toPattern() | |
| 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-
| |