Package javax.measure.unit

Examples of javax.measure.unit.ProductUnit


    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());
        }
        else if (javax.measure.unit.AlternateUnit.class.isInstance(u)){
                  retval=((AlternateUnit)u).getParent();
                  /* Now split again */
                   Logger.getLogger("com.CompPad").log(Level.FINE,
View Full Code Here

TOP

Related Classes of javax.measure.unit.ProductUnit

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.