Back to Joe's Java IndexBack to Units Package page


Units Package

Revision History

 

November 3, 1998

Original reslease of my Units package.

October 6, 1999

Improved documentation everywhere.

Added the following new unit types: Poise, Centipoise, 1/ft, 1/in, 1/km, 1/m, 1/mm, 1/nm, 1/mi, kg/m-s,N-s/m^2, lbf-s/ft^2, lb/ft-s,

Added a method that indicates if a particular unit can be converted to the reference unit for that unit type exactly or not. This info was added to the documentation as well.

November 20, 1999

Major rewrite of the entire package.

All unit classes are now immutable singletons. Once a unit class has been instantiated the first time, every other time that you request a new instance of that unit, you will simply get a reference to that first instance. This gives a HUGE improvement in performance when using units inside methods or loops that are called repeatedly since there is no overhead for unit creation after the first instance.

Since unit classes are now immutable, the unit object no longer changes type underneath you when you use the convert() method. This change also makes the unit objects more well behaved (no more black magic to change the type of an already existing object).

Added the method compatible() you can use to determine if you can convert one unit object into another.

All bottom level unit classes have been made "final" since it doesn't make sense to extend them.

June 10, 2000

Made all classes "Serializable"

Package now requires Java 1.1 or later.

Fixed bug with Temperature units.

Broke all public classes out into their own *.java file per the Java standard. My development environment (Codewarrior) doesn't require this, but other platforms do. This will make the code easier for others to recompile on their own platforms.


Created: October 6, 1999
Modified: June 8, 2002