advertisement

Article:
  Apples and Oranges (and the Java Units Specification)
Subject:   Additional information on JADE
Date:   2004-01-08 07:12:18
From:   anonymous2
This article is an excellent overview of the JSR-108/units package specification.
Here are additional information regarding JADE’s examples which might be of interest to the readers:
- The digit length of standard quantity output (e.g. 0.1839991624733684 hp•s2/Didot) may surprise some. JADE’s quantities embed automatic error calculations and all digits guaranteed to be exact are written. As quantities lose precision (e.g. due to numeric errors), less digits are written.


- Compatibility between units is based upon the current physical model. The standard model (default) does not allows for conversion between
SI.METER and SI.SECOND but such conversion is allowed with the relativistic model. JADE’s provides five predefined models: Standard, Relativistic, High-Energy, Quantum and Natural. Users may also create their own.


- JADE’ dimension-checking is done in the form of class-type checking (the unit determinates the class of a quantity). In the calcAcceleration example, the return value could also have been written:
return (Acceleration) finalVelocity.subtract(initialVelocity).divide(duration));


- For money, JADE’s provide a sub-class of Unit called Currency for which the exchange rate can be set dynamically.


- Regarding the future, a new version of JADE coming up this week-end will allow a quantity amount to be any “Operable” element. This includes integer values (e.g. LargeInteger) but also vectors (Matrix), complex numbers (Complex), a function (Function) or any class implementing the Operable interface.


Regards.
Jean-Marie Dautelle.

Full Threads Oldest First

Showing messages 1 through 4 of 4.

  • Additional information on JADE
    2004-03-29 22:58:23  _j_j-solveig [Reply | View]

    After reading this article, and some here, JADE seems to be quite easy to understand.
  • Additional information on JADE
    2004-01-11 09:38:16  anonymous2 [Reply | View]

    The official release of JADE’s new version is scheduled for January 18 2004.
    It is a major release (V6.0) with the following improvements regarding quantities:
    - Support for exact quantities. Operations on exact quantities typically result in exact quantities (but not always e.g. squareRoot(2)). A new method isExact() indicates if a quantity is exact or an approximation.
    - Internal representation of quantities using integer mantissa and decimal exponents to ensure exact mapping between a quantity and its decimal representation)
    - New QuantityFormat class with support for the ± symbol (e.g. 1.2 ± 0.001 kg).
    - Finally Quantity implements the new (V6.0) interface Recyclable (intermediate/temporary objects can be reused without incurring the cost of memory allocation, object initialization and potential garbage collection).

    Jean-Marie Dautelle.
  • JADE
    2004-01-08 14:20:00  orik [Reply | View]

    Thank you Jean-Marie, both for the extra info and for creating JADE.

  • Additional information on JADE
    2004-01-08 13:53:41  anonymous2 [Reply | View]

    Excellent library. Keep up the great work and thanks for opening it up for the world to use.