Use Advanced Search to search the entire archive.
Re: Remove "generic" multiply/divide operations from Quantity
- From: Martin Desruisseaux <
>
- To:
- Subject: Re: Remove "generic" multiply/divide operations from Quantity
- Date: Sat, 18 Oct 2014 16:48:41 +0900
- Organization: Geomatys
Le 17/10/14 11:06, Otávio Gonçalves de Santana a écrit:
>
Is there any place in the new JavaSE API that does something like you
>
propose to do?
On my objections against UNITSOFMEASUREMENT-62, of course not since I
claim that this proposal breaks the rule of the Java language, and
consequently is unacceptable in a standard API.
On my proposal to keep this signature:
Quantity<?> multiply(Quantity<?> other)
Then examples in the JaveSE API are all examples that returns minimum or
maximum values as comparable objects:
* Comparable<?> getMinimum() in javax.swing.text.InternationalFormatter
* Comparable<?> getMinimum() in javax.swing.SpinnerNumberModel
* Comparable<?> getMinValue() in
javax.management.openmbean.OpenMBeanAttributeInfoSupport
* Comparable<?> getObjectMinValue(String elementName) in
javax.imageio.metadata.IIOMetadataFormat
Return values of those getMinimum() methods can not be safety casted to
Comparable<Double>, but can be safely casted to Double. See, this is
exactly the same than what I proposed with the Energy example.
Martin