/* This method should return units either in SI, NonSI, or combinations of
* units acording to the Unit.valueOf format. */
private static javax.measure.unit.Unit splitUnits(javax.measure.unit.Unit u){
Unit retval=Unit.ONE;
u=u.getStandardUnit();
/* If it's a ProductUnit, then split it and then call splitUnits */
if (javax.measure.unit.ProductUnit.class.isInstance(u)){
ProductUnit pu=(ProductUnit)u;
for (int i=0;i<pu.getUnitCount();++i){
/* First check to see if this unit needs split */
Unit ux =splitUnits(pu.getUnit(i));
retval=retval.times(ux.pow(pu.getUnitPow(i)));
}
/* Now split again */
Logger.getLogger("com.CompPad").log(Level.FINE,"ProductUnit "
+ pu.getUnitCount());
}