MonetaryAmount. The class extends
java.lang.Number for maximal compatibility with the JDK but also adds additional functionality to
overcome some of the pitfalls of the JDK's Number class.
Implementations of this interface must be :
| Modifier and Type | Field and Description |
|---|---|
| private static final long | serialVersionUID
serialVersionUID.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public int | compareTo(NumberValue
the object to be compared. other)Implements java. |
| public abstract double | Returns: the (possibly) truncated value of theMonetaryAmount.Access the numeric value as |
| public abstract long | Returns: the amount's fraction denominator.This method allows to extract the denominator part of the current fraction, hereby given
|
| public abstract long | Returns: the amount's fraction numerator..This method allows to extract the numerator part of the current fraction, hereby given
|
| public abstract Class | Returns: the numeric implementation type, notnull.Get the numeric implementation type, that is the base of this number. |
| public abstract int | Returns: the precision of thisMonetaryAmount.Returns the precision of this |
| public abstract int | |
| public abstract int | Returns: the (possibly) truncated value of theMonetaryAmount.Access the numeric value as |
| public abstract long | Returns: the (possibly) truncated value of theMonetaryAmount.Access the numeric value as |
| public abstract <T extends Number> T | Returns: the (possibly) truncated value of theMonetaryAmount.The concrete number class to be returned. Basically the following Number types,
must be supported if available on the corresponding runtime platform:
numberType)
Access the numeric value as |
| public abstract <T extends Number> T | Returns: the (possibly) truncated value of theMonetaryAmount.The concrete number class to be returned. Basically the following Number types,
must be supported if available on the corresponding runtime platform:
numberType)
Access the numeric value as |
| public abstract NumberValue | Returns: the new NumberValue, never null.the mathContext)java.math.MathContext to be applied.Access the current NumberValue rounded using the given |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. serialVersionUID. | |
| NumberValue | back to summary |
|---|---|
| public NumberValue() | |
| compareTo | back to summary |
|---|---|
| public int compareTo(NumberValue other) 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
| |
| doubleValueExact | back to summary |
|---|---|
| public abstract double doubleValueExact() Access the numeric value as
| |
| getAmountFractionDenominator | back to summary |
|---|---|
| public abstract long getAmountFractionDenominator() This method allows to extract the denominator part of the current fraction, hereby given
the following must be always true:
.
| |
| getAmountFractionNumerator | back to summary |
|---|---|
| public abstract long getAmountFractionNumerator() This method allows to extract the numerator part of the current fraction, hereby given
the following must be always true:
.
| |
| getNumberType | back to summary |
|---|---|
| public abstract Class Get the numeric implementation type, that is the base of this number.
| |
| getPrecision | back to summary |
|---|---|
| public abstract int getPrecision() Returns the precision of this The precision of a zero value is 1.
| |
| getScale | back to summary |
|---|---|
| public abstract int getScale() Returns the scale of this
| |
| intValueExact | back to summary |
|---|---|
| public abstract int intValueExact() Access the numeric value as
| |
| longValueExact | back to summary |
|---|---|
| public abstract long longValueExact() Access the numeric value as
| |
| numberValue | back to summary |
|---|---|
| public abstract <T extends Number> T numberValue(Class<T> numberType) Access the numeric value as
| |
| numberValueExact | back to summary |
|---|---|
| public abstract <T extends Number> T numberValueExact(Class<T> numberType) Access the numeric value as
| |
| round | back to summary |
|---|---|
| public abstract NumberValue round(MathContext mathContext) Access the current NumberValue rounded using the given
| |