Use Advanced Search to search the entire archive.
Add five methods in Quantity interface[Proposal]
- From: Otávio Gonçalves de Santana <
>
- To:
- Subject: Add five methods in Quantity interface[Proposal]
- Date: Fri, 31 Oct 2014 17:36:12 -0200
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