Uses of Interface
javax.money.MonetaryAmount
Package | Description |
---|---|
javax.money |
Main package of the Money and Currency API.
|
javax.money.convert |
Defines the monetary currency conversion API.
|
javax.money.format |
Money and Currency format API.
|
javax.money.spi |
SPI interfaces of the Money and Currency API, including bootstrap logic.
|
-
Uses of MonetaryAmount in javax.money
Classes in javax.money with type parameters of type MonetaryAmount Modifier and Type Interface Description interface
MonetaryAmountFactory<T extends MonetaryAmount>
Factory forMonetaryAmount
instances for a given type.Methods in javax.money with type parameters of type MonetaryAmount Modifier and Type Method Description static <T extends MonetaryAmount>
MonetaryAmountFactory<T>Monetary. getAmountFactory(java.lang.Class<T> amountType)
Access anMonetaryAmountFactory
for the givenMonetaryAmount
implementation type.Methods in javax.money that return MonetaryAmount Modifier and Type Method Description MonetaryAmount
MonetaryAmount. abs()
Returns aMonetaryAmount
whose value is the absolute value of thisMonetaryAmount
, and whose scale isthis.getContext().getMaxScale()
.MonetaryAmount
MonetaryAmount. add(MonetaryAmount augend)
Returns aMonetaryAmount
whose value isthis + augend
, and whose scale ismax(this.getContext().getMaxScale(), augend.getContext().getMaxScale())
.MonetaryAmount
MonetaryOperator. apply(MonetaryAmount amount)
Applies the operator on the given amount.MonetaryAmount
MonetaryAmount. divide(double divisor)
Returns aMonetaryAmount
whose value isthis / divisor
, and whose preferred scale isthis.getContext().getMaxScale() - divisor.getContext().getMaxScale()
; if the exact quotient cannot be represented anArithmeticException
is thrown.MonetaryAmount
MonetaryAmount. divide(long divisor)
Returns aMonetaryAmount
whose value isthis / divisor
, and whose preferred scale isthis.getContext().getMaxScale() - divisor.getContext().getMaxScale()
; if the exact quotient cannot be represented anArithmeticException
is thrown.MonetaryAmount
MonetaryAmount. divide(java.lang.Number divisor)
Returns aMonetaryAmount
whose value isthis / divisor
, and whose preferred scale isthis.getContext().getMaxScale() - divisor.getContext().getMaxScale()
; if the exact quotient cannot be represented anArithmeticException
is thrown.MonetaryAmount[]
MonetaryAmount. divideAndRemainder(double divisor)
Returns a two-elementMonetaryAmount
array containing the result ofdivideToIntegralValue
followed by the result ofremainder
on the two operands.MonetaryAmount[]
MonetaryAmount. divideAndRemainder(long divisor)
Returns a two-elementMonetaryAmount
array containing the result ofdivideToIntegralValue
followed by the result ofremainder
on the two operands.MonetaryAmount[]
MonetaryAmount. divideAndRemainder(java.lang.Number divisor)
Returns a two-elementMonetaryAmount
array containing the result ofdivideToIntegralValue
followed by the result ofremainder
on the two operands.MonetaryAmount
MonetaryAmount. divideToIntegralValue(double divisor)
Returns aMonetaryAmount
whose value is the integer part of the quotientthis / divisor
rounded down.MonetaryAmount
MonetaryAmount. divideToIntegralValue(long divisor)
Returns aMonetaryAmount
whose value is the integer part of the quotientthis / divisor
rounded down.MonetaryAmount
MonetaryAmount. divideToIntegralValue(java.lang.Number divisor)
Returns aMonetaryAmount
whose value is the integer part of the quotientthis / divisor
rounded down.MonetaryAmount
MonetaryAmount. multiply(double multiplicand)
Returns aMonetaryAmount
whose value is(this × multiplicand)
, and whose scale isthis.getContext().getMaxScale() + multiplicand.getContext().getMaxScale()
.MonetaryAmount
MonetaryAmount. multiply(long multiplicand)
Returns aMonetaryAmount
whose value is(this × multiplicand)
, and whose scale isthis.getContext().getMaxScale() + multiplicand.getContext().getMaxScale()
.MonetaryAmount
MonetaryAmount. multiply(java.lang.Number multiplicand)
Returns aMonetaryAmount
whose value is(this × multiplicand)
, and whose scale isthis.getContext().getMaxScale() + multiplicand.getContext().getMaxScale()
.MonetaryAmount
MonetaryAmount. negate()
Returns aMonetaryAmount
whose value is-this
, and whose scale isthis.getContext().getMaxScale()
, with rounding according to the context settings.MonetaryAmount
MonetaryAmount. plus()
Returns aMonetaryAmount
whose value is+this
.MonetaryAmount
MonetaryAmount. remainder(double divisor)
Returns aMonetaryAmount
whose value isthis % divisor
.MonetaryAmount
MonetaryAmount. remainder(long divisor)
Returns aMonetaryAmount
whose value isthis % divisor
.MonetaryAmount
MonetaryAmount. remainder(java.lang.Number divisor)
Returns aMonetaryAmount
whose value isthis % divisor
.MonetaryAmount
MonetaryAmount. scaleByPowerOfTen(int power)
Returns aMonetaryAmount
whose numerical value is equal to (this
* 10n).MonetaryAmount
MonetaryAmount. stripTrailingZeros()
Returns aMonetaryAmount
which is numerically equal to this one but with any trailing zeros removed from the representation.MonetaryAmount
MonetaryAmount. subtract(MonetaryAmount subtrahend)
Returns aMonetaryAmount
whose value isthis - amount
, and whose scale ismax(this.getContext().getMaxScale(), subtrahend.getContext().getMaxScale()
.default MonetaryAmount
MonetaryAmount. with(MonetaryOperator operator)
Returns an operated object of the same type as this object with the operation made.Methods in javax.money that return types with arguments of type MonetaryAmount Modifier and Type Method Description java.lang.Class<? extends MonetaryAmount>
MonetaryAmountFactory. getAmountType()
Access theMonetaryAmount
implementation type.java.lang.Class<? extends MonetaryAmount>
MonetaryContext. getAmountType()
Get the MonetaryAmount implementation class.static java.util.Collection<java.lang.Class<? extends MonetaryAmount>>
Monetary. getAmountTypes()
Access all currently availableMonetaryAmount
implementation classes that are accessible from thisMonetaryAmount
singleton.static java.lang.Class<? extends MonetaryAmount>
Monetary. getDefaultAmountType()
Access the defaultMonetaryAmount
implementation class that is accessible from thisMonetaryAmount
singleton.MonetaryAmountFactory<? extends MonetaryAmount>
MonetaryAmount. getFactory()
Creates a newMonetaryAmountFactory
, returning the same implementation type Hereby this given amount is used as a template, so reusing theCurrencyUnit
, its numeric value, the algorithmic implementation as well as the currentMonetaryContext
.Methods in javax.money with parameters of type MonetaryAmount Modifier and Type Method Description MonetaryAmount
MonetaryAmount. add(MonetaryAmount augend)
Returns aMonetaryAmount
whose value isthis + augend
, and whose scale ismax(this.getContext().getMaxScale(), augend.getContext().getMaxScale())
.MonetaryAmount
MonetaryOperator. apply(MonetaryAmount amount)
Applies the operator on the given amount.boolean
MonetaryAmount. isEqualTo(MonetaryAmount amount)
Compares two instances ofMonetaryAmount
, hereby ignoring non significant trailing zeroes and different numeric capabilities.boolean
MonetaryAmount. isGreaterThan(MonetaryAmount amount)
Compares two instances ofMonetaryAmount
, hereby ignoring non significant trailing zeroes and different numeric capabilities.boolean
MonetaryAmount. isGreaterThanOrEqualTo(MonetaryAmount amount)
Compares two instances ofMonetaryAmount
, hereby ignoring non significant trailing zeroes and different numeric capabilities.boolean
MonetaryAmount. isLessThan(MonetaryAmount amount)
Compares two instances ofMonetaryAmount
, hereby ignoring non significant trailing zeroes and different numeric capabilities.boolean
MonetaryAmount. isLessThanOrEqualTo(MonetaryAmount amt)
Compares two instances ofMonetaryAmount
, hereby ignoring non significant trailing zeroes and different numeric capabilities.R
MonetaryQuery. queryFrom(MonetaryAmount amount)
Queries the specified monetary amount.default MonetaryAmountFactory<T>
MonetaryAmountFactory. setAmount(MonetaryAmount amount)
Uses an arbitraryMonetaryAmount
to initialize this factory.MonetaryAmount
MonetaryAmount. subtract(MonetaryAmount subtrahend)
Returns aMonetaryAmount
whose value isthis - amount
, and whose scale ismax(this.getContext().getMaxScale(), subtrahend.getContext().getMaxScale()
.Method parameters in javax.money with type arguments of type MonetaryAmount Modifier and Type Method Description static MonetaryContext
MonetaryContext. from(MonetaryAmountFactoryQuery monetaryAmountFactoryQuery, java.lang.Class<? extends MonetaryAmount> amountClass)
This method allows to easily of a new MonetaryContext instance from a given.MonetaryAmountFactoryQuery
.static MonetaryContext
MonetaryContext. from(MonetaryContext monetaryContext, java.lang.Class<? extends MonetaryAmount> amountClass)
Creates a new MonetaryContext).static MonetaryContextBuilder
MonetaryContextBuilder. of(java.lang.Class<? extends MonetaryAmount> amountType)
Creates a new builder, hereby the target implementation type is required.MonetaryContextBuilder
MonetaryContextBuilder. setAmountType(java.lang.Class<? extends MonetaryAmount> amountType)
Set the MonetaryAmount implementation class. -
Uses of MonetaryAmount in javax.money.convert
Methods in javax.money.convert with parameters of type MonetaryAmount Modifier and Type Method Description ExchangeRate
CurrencyConversion. getExchangeRate(MonetaryAmount sourceAmount)
Get theExchangeRate
applied for the givenMonetaryAmount
. -
Uses of MonetaryAmount in javax.money.format
Methods in javax.money.format that return MonetaryAmount Modifier and Type Method Description MonetaryAmount
MonetaryAmountFormat. parse(java.lang.CharSequence text)
Fully parses the text into an instance ofMonetaryAmount
.Methods in javax.money.format with parameters of type MonetaryAmount Modifier and Type Method Description default java.lang.String
MonetaryAmountFormat. format(MonetaryAmount amount)
Formats the givenMonetaryAmount
to a String.void
MonetaryAmountFormat. print(java.lang.Appendable appendable, MonetaryAmount amount)
Formats the givenMonetaryAmount
to aAppendable
. -
Uses of MonetaryAmount in javax.money.spi
Classes in javax.money.spi with type parameters of type MonetaryAmount Modifier and Type Interface Description interface
MonetaryAmountFactoryProviderSpi<T extends MonetaryAmount>
SPI (core): Implementations of this interface are used by theMonetaryAmountsSingletonSpi
to evaluate the correctMonetaryAmountFactory
instances.Methods in javax.money.spi with type parameters of type MonetaryAmount Modifier and Type Method Description <T extends MonetaryAmount>
MonetaryAmountFactory<T>MonetaryAmountsSingletonSpi. getAmountFactory(java.lang.Class<T> amountType)
Access theMonetaryAmountFactory
for the givenamountType
.Methods in javax.money.spi that return types with arguments of type MonetaryAmount Modifier and Type Method Description java.util.Collection<MonetaryAmountFactory<? extends MonetaryAmount>>
MonetaryAmountsSingletonQuerySpi. getAmountFactories(MonetaryAmountFactoryQuery query)
Get theMonetaryAmountFactory
implementation class, that best matches to cover the givenMonetaryContext
.default java.lang.Class<? extends MonetaryAmount>
MonetaryAmountsSingletonQuerySpi. getAmountType(MonetaryAmountFactoryQuery query)
Executes the query and returns theMonetaryAmount
implementation type found, if there is only one type.default java.util.Collection<java.lang.Class<? extends MonetaryAmount>>
MonetaryAmountsSingletonQuerySpi. getAmountTypes(MonetaryAmountFactoryQuery query)
Executes the query and returns theMonetaryAmount
implementation types found.java.util.Collection<java.lang.Class<? extends MonetaryAmount>>
MonetaryAmountsSingletonSpi. getAmountTypes()
Get the currently registeredMonetaryAmount
implementation types.java.lang.Class<? extends MonetaryAmount>
MonetaryAmountsSingletonSpi. getDefaultAmountType()
Access the defaultMonetaryAmount
implementation type.