|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectucar.units.ConverterImpl
public abstract class ConverterImpl
Provides support for implementations of unit converters. A unit converter
class may be created by subclassing this class and implementing the methods
convert(double), convert(float[] input, float[] output)
, and convert(double[] input, double[] output) of
interface Converter.
| Constructor Summary | |
|---|---|
protected |
ConverterImpl(Unit fromUnit,
Unit toUnit)
Constructs from a "from" unit and a "to" unit. |
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ucar.units.Converter |
|---|
convert, convert, convert |
| Constructor Detail |
|---|
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.| Method Detail |
|---|
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)
convert in interface Converteramount - The numeric value to convert.
public final float[] convert(float[] amounts)
convert in interface Converteramounts - The numeric values to convert.
public final double[] convert(double[] amounts)
convert in interface Converteramounts - The numeric values to convert.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||