Use Advanced Search to search the entire archive.
Re: Add five methods in Quantity interface[Proposal]
- From: Werner Keil <
>
- To: "
" <
>
- Subject: Re: Add five methods in Quantity interface[Proposal]
- Date: Fri, 31 Oct 2014 20:55:58 +0100
Let's have a look at it after the actual place of any such method is
clarified.
Feel free to create a JIRA ticket at any time.
Do they match JavaMoney (JSR 354/Moneta) equivalents btw.?
It's good to have that in JIRA, we'll figure our, if this helps on an API
level or otherwise for RI.
Thanks,
Werner
On Fri, Oct 31, 2014 at 8:36 PM, Otávio Gonçalves de Santana <
>
wrote:
>
I would like to propose to add four new comparatives methods in Quantity
>
interface:
>
>
>
- boolean isGreaterThan(Quantity<T> quantity);
>
- boolean isGreaterThanOrEqualTo(Quantity<T> quantity);
>
- boolean isLessThan(Quantity<T> quantity);
>
- boolean isLessThanOrEqualTo(Quantity<T> quantity);
>
- boolean isEquivalentTo(Quantity<T> quantity);
>
>
The implementation should convert to the same unit and than compare.
>
So:
>
>
Quantity<Time> oneHour = ...
>
Quantity<Time> sixtyMinutes = ...
>
>
Should return true, when: oneHour.isEquivalentTo(sixtyMinutes);
>
--
>
Otávio Gonçalves de Santana
>
>
blog: http://otaviosantana.blogspot.com.br/
>
twitter: http://twitter.com/otaviojava
>
site: *http://about.me/otaviojava <http://about.me/otaviojava>*
>
55 (11) 98255-3513
>
>