Use Advanced Search to search the entire archive.
Re: Remove "generic" multiply/divide operations from Quantity
- From: Otávio Gonçalves de Santana <
>
- To:
- Subject: Re: Remove "generic" multiply/divide operations from Quantity
- Date: Sat, 18 Oct 2014 16:20:35 -0300
Martin, maybe I expressed me bad.
Java has the Generic resources in Java 1.5, but it should to keep the
compatibility to older version of Java.
When I told "new API", I means API after the generics, in other words, Java
1.6 or above.
If you look to the Since annotations of this example you will see almost
always 1.4 and Just one 1.5 , in other words, no one is new API.
http://docs.oracle.com/javase/7/docs/api/javax/swing/text/InternationalFormatter.html
http://docs.oracle.com/javase/7/docs/api/javax/swing/SpinnerNumberModel.html
http://docs.oracle.com/javase/7/docs/api/java/util/Comparator.html
http://docs.oracle.com/javase/8/docs/api/javax/imageio/metadata/IIOMetadataFormat.html
http://docs.oracle.com/javase/7/docs/api/javax/management/openmbean/OpenMBeanAttributeInfoSupport.html
But ok.
On Sat, Oct 18, 2014 at 4:48 AM, Martin Desruisseaux <
>
wrote:
>
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
>
>
>
--
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