Thanks a lot for sharing this request.
As Jean-Marie already mentioned, at least indirectly, default unit systems like SI are now part of implementations as many of its types rely more or less directly on implementing classes like BaseUnit, TransformedUnit, etc.
UOMo calls it SI, and although package-local to support other formal system classes, NonSI is also there. The class to find INCH now is USCustomary. ICU4J, the underlying Unicode and Globalization Framework uses both these terms internally, too, so I decide to stick with them.
JScience may or may not call them like that, and unless any of those classes/interfaces ever got back into a common spec, it is free for every implementation to declare unit systems as they like. UOMo has some others in development, some also specific to UCUM or local requirements, e.g. for Asian countries like India or China. Which ICU4J again supports with corresponding calendars.
As for the code, I cannot say for sure, that an equivalent to RelativisticModel currently exists in UOMo or underlying frameworks like ICU4J. That is the only case, all other classes exist while some may be defined by ICU4J (like improved forms of BigDecimal, etc.)
The monetary/trip cost example from JScience:
http://www.jscience.org/api/org/jscience/economics/money/package-summary.html#package_description
Is a bit of a quasi TCK I used as of JScience4. The results are identical (except a bit of rounding or formatting) although UOMo Business is also still being finalized for some parts like Currency Conversion, so that part may look a bit different at the moment. All other figures match and could in most cases withstand a JUnit type of test (even without calling it a JSR for now, we may create such tests, as long as our "TCK" is open and non-restrictive ;-)
Kind Regards,
Werner
-------- Original-Nachricht --------
> Datum: Thu, 16 Dec 2010 12:02:04 +0100
> Von: Martin Desruisseaux <martin.de...@geomatys.fr>
> An: unitsof...@jscience.dev.java.net
> CC: tro...@IMR.no
> Betreff: [unitsofmeasure] State of implementations?
> Hello all
>
> We got the following question from a user about JScience implementation of
> Unit-API. Does someone could give us some clues?
>
> On a related side, I would like to take the opportunity for asking if
> there is
> any news on the implementation side (JScience and UOMo)?
>
> Regards,
>
> Martin
>
>
> > I thought it would be a good idea just to make a small example for
> myself and downloaded:
> >
> > jscience-5.0-SNAPSHOT.jar and unit-api-0.6-RC1.jar
> >
> > I included these jar files in the project and tried to cut and paste an
> example from the javadoc.
> > Obviously these examples are not complete and the complete examples I
> found in Java World Articles etc was with the previous javax.* interface.
> >
> > Here is my source code:
> >
> > package unitsofmeasurements;
> > import org.jscience.mathematics.number.Float64;
> > import org.jscience.physics.amount.Amount;
> > import org.jscience.physics.model.RelativisticModel;
> > import org.unitsofmeasurement.unit.Unit;
> > import org.unitsofmeasurement.unit.SystemOfUnits;
> > import org.unitsofmeasurement.quantity.Length;
> > import org.unitsofmeasurement.quantity.Mass;
> > public class Main {
> > public static void main(String[] args) {
> >
> > RelativisticModel.select(); // Selects a relativistic model.
> > Amount<Float64, Length> x = Amount.valueOf(100, NonSI.INCH);
> > x = x.plus(Amount.valueOf("2.3 µs")).to(METRE); // Length and
> Duration can be added.
> > Amount<Float64, Mass> m = Amount.valueOf(12,
> Unit.ValueOf("GeV")).to(KILOGRAM); // Energy is compatible with mass (E=mc2)
> >
> > }
> > }
> >
> > THE PROBLEM: The static import of SI.* and NonSI.* I am not able to find
> them ????
> >
> > Can you give me a hint ?
> >
> > Best regards
> >
> > Trond
--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail