Top Description Constructors Methods
org.javamoney.moneta.function

pack-priv final Class ExtractorMinorPartQuery

extends Object
implements MonetaryQuery<Long>
Class Inheritance
All Implemented Interfaces
javax.money.MonetaryQuery
Imports
java.math.BigDecimal, .RoundingMode, java.util.Objects, javax.money.MonetaryAmount, .MonetaryQuery

This class allows to extract the minor part of a MonetaryAmount instance.
Authors
Anatole Tresch, Otavio Santana

Constructor Summary

AccessConstructor and Description
pack-priv
ExtractorMinorPartQuery()

Package private constructor used from MonetaryFunctions.

Method Summary

Modifier and TypeMethod and Description
public Long

Returns:

the minor units part of the amount, never null
queryFrom
(MonetaryAmount amount)

Implements javax.money.MonetaryQuery.queryFrom.

Extract the minor part of a MonetaryAmount with the same scale.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExtractorMinorPartQueryback to summary
pack-priv ExtractorMinorPartQuery()

Package private constructor used from MonetaryFunctions.

Method Detail

queryFromback to summary
public Long queryFrom(MonetaryAmount amount)

Implements javax.money.MonetaryQuery.queryFrom.

Extract the minor part of a MonetaryAmount with the same scale.

This returns the monetary amount in terms of the minor units of the currency, truncating the whole part if necessary. For example, 'EUR 2.35' will return 35, and 'BHD -1.345' will return -345.

This is returned as a MonetaryAmount rather than a BigDecimal . This is to allow further calculations to be performed on the result. Should you need a BigDecimal, simply call asType(BigDecimal.class).

Returns:Long

the minor units part of the amount, never null

Annotations
@Override