public abstract class ConverterImpl extends java.lang.Object implements Converter
convert(double)
, convert(float[] input, float[] output)
, and convert(double[] input, double[] output)
of
interface Converter
.Modifier | Constructor and Description |
---|---|
protected |
ConverterImpl(Unit fromUnit,
Unit toUnit)
Constructs from a "from" unit and a "to" unit.
|
Modifier and Type | Method and Description |
---|---|
double[] |
convert(double[] amounts)
Converts an array of numeric values.
|
float |
convert(float amount)
Converts a numeric value.
|
float[] |
convert(float[] amounts)
Converts an array of numeric values.
|
static Converter |
create(Unit fromUnit,
Unit toUnit)
Factory method for creating a unit converter.
|
protected ConverterImpl(Unit fromUnit, Unit toUnit) throws ConversionException
fromUnit
- The unit from which to convert.toUnit
- The unit to which to convert.ConversionException
- The units are not convertible.public static Converter create(Unit fromUnit, Unit toUnit) throws ConversionException
fromUnit
- The unit from which to convert.toUnit
- The unit to which to convert.ConversionException
- The units are not convertible.public final float convert(float amount)
public final float[] convert(float[] amounts)