Hello,
I'm wondering, is there a better way to name Units that were created by
parse other than:
UnitFormat format = UnitFormatManager.instance();
Unit precipRateUnit = format.parse("in per
day").clone(UnitName.newUnitName("in per day"));
Aside from being verbose and inefficient (two distinct Unit instances
created just to get one that's named), I've found some cases in which
Units created in this manner are not compatible with other Units that
they should be. For example:
UnitFormat format = UnitFormatManager.instance();
Unit kelvinUnit = format.parse("kelvin")
.clone(UnitName.newUnitName("kelvin"));
Unit fahrenUnit =
format.parse("fahrenheit").clone(UnitName.newUnitName("fahrenheit"));
System.out.println(kelvinUnit.isCompatible(fahrenUnit)); //
Prints "false"
Please advise.
Thanks,
Christian Ward-Garrison