Skip to main content

[jsr363-experts] Re: Quantity.doubleValue(...) ?

  • From: Werner Keil < >
  • To: " " < >
  • Subject: [jsr363-experts] Re: Quantity.doubleValue(...) ?
  • Date: Mon, 15 Dec 2014 16:49:53 +0100

On Mon, Dec 15, 2014 at 4:08 PM, Martin Desruisseaux <
>
 wrote:
>
>  Le 15/12/14 22:03, Werner Keil a écrit :
>
>    (...snip...) The concept of base units exists no matter how we
>> represent it. Whether a particular implementation decides to define a
>> BaseUnit class for holding that concept or not is an implementation
>> details.
>>
> As there are so many possible systems (custom implementations like
> "Health" or "Fitness" or country-specific ones, what should they all return
> there?
>
> They would return their own set of base units, which are different than
> the SI ones.
>
> Base units is at the very core of the whole JSR-363 project, even if there
> is no explicit BaseUnit type (because this is not necessary): all
> SystemOfUnits is defined by a small set of base units, from which other
> units are derived.
>
>
>
You're not suggesting, concrete classes like BaseUnit are not necessary,
are you?
Even the first approach had a very similar hierarchy:
http://jsr-108.sourceforge.net/javadoc/javax/units/package-summary.html

The extra layer of DerivedUnit was spared from JSR-275, what was once due
to a mix between API and RI just a Unit class is now an interface
implemented by AbstractUnit, the abstract base class all units should
derive from.

https://github.com/unitsofmeasurement/uom-impl-enum shows, if you write
another implementation, there are alternatives to an abstract base class
and since all units extend Enum there is no real hierarchy like in the
other implementations. The final nature of the enum poses a lot of
restrictions onto even unit conversion, so this implementation is merely a
PoC and the most experimental one. Simply as a drop-in e.g. to test it on
ME if the RI still got a few things we should sort out (e.g. Locale usage
in several places;-)

Werner


[jsr363-experts] Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Werner Keil 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/15/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/16/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Leonardo Lima 12/16/2014

[jsr363-experts] Re: Quantity.doubleValue(...) ?

Martin Desruisseaux 12/16/2014
 
 
Close
loading
Please Confirm
Close