/** * Converts a numeric value from this unit to another unit. * * @param amount * The numeric value. * @param outputUnit * The unit to which to convert the numeric value. * @return The numeric value in the output unit. * @throws ConversionException * The units aren't convertible. */ public float convertTo(final float amount, final Unit outputUnit) throws ConversionException { return (float) convertTo((double) amount, outputUnit); }
/** * Converts numeric values from this unit to another unit. * * @param amounts * The numeric values. * @param outputUnit * The unit to which to convert the numeric values. * @return The numeric values in the output unit in allocated space. * @throws ConversionException * The units aren't convertible. */ public float[] convertTo(final float[] amounts, final Unit outputUnit) throws ConversionException { return convertTo(amounts, outputUnit, new float[amounts.length]); }
/** * Converts numeric values from this unit to another unit. * * @param amounts * The numeric values. * @param outputUnit * The unit to which to convert the numeric values. * @return The numeric values in the output unit in allocated space. * @throws ConversionException * The units aren't convertible. */ public double[] convertTo(final double[] amounts, final Unit outputUnit) throws ConversionException { return convertTo(amounts, outputUnit, new double[amounts.length]); }
/** * Converts a numeric value from this unit to another unit. * * @param amount * The numeric value. * @param outputUnit * The unit to which to convert the numeric value. * @return The numeric value in the output unit. * @throws ConversionException * The units aren't convertible. */ public float convertTo(final float amount, final Unit outputUnit) throws ConversionException { return (float) convertTo((double) amount, outputUnit); }
/** * Converts numeric values from this unit to another unit. * * @param amounts * The numeric values. * @param outputUnit * The unit to which to convert the numeric values. * @return The numeric values in the output unit in allocated space. * @throws ConversionException * The units aren't convertible. */ public float[] convertTo(final float[] amounts, final Unit outputUnit) throws ConversionException { return convertTo(amounts, outputUnit, new float[amounts.length]); }
/** * Converts numeric values from this unit to another unit. * * @param amounts * The numeric values. * @param outputUnit * The unit to which to convert the numeric values. * @return The numeric values in the output unit in allocated space. * @throws ConversionException * The units aren't convertible. */ public double[] convertTo(final double[] amounts, final Unit outputUnit) throws ConversionException { return convertTo(amounts, outputUnit, new double[amounts.length]); }