Interface BaseConverter

All Superinterfaces:
Serializable
All Known Implementing Classes:
CConverter, CgConverter, CmConverter, DistanceConverter, FConverter, FtConverter, GConverter, InConverter, KConverter, KgConverter, KmConverter, LbConverter, MConverter, MgConverter, MiConverter, MmConverter, OzConverter, StConverter, TemperaturesConverter, WeightsConverter, YdConverter

public interface BaseConverter extends Serializable
Interface that defines the two mandatory methods, to make conversions between units measurement.
  • Method Summary

    Modifier and Type
    Method
    Description
    Makes the conversions from the base uinit measurement value to the actual unit representation desired.
    For example, from meters to kilometers or from meters to miles ecc.
    Makes the conversions from the actual unit representation value to the base uinit measurement value.
    For example, the base unit for kilometers and miles are meters, the base units for the kilograms and pounds are the grams ecc.
  • Method Details

    • toBaseUnit

      BigDecimal toBaseUnit(BigDecimal value)
      Makes the conversions from the actual unit representation value to the base uinit measurement value.
      For example, the base unit for kilometers and miles are meters, the base units for the kilograms and pounds are the grams ecc.
      Parameters:
      value - The value (with its current unit representation) from which start the conversion.
      Returns:
      The base uinit measurement for the value.
    • fromBaseUnit

      BigDecimal fromBaseUnit(BigDecimal value)
      Makes the conversions from the base uinit measurement value to the actual unit representation desired.
      For example, from meters to kilometers or from meters to miles ecc.
      Parameters:
      value - The value representing the base unit from which starting the conversion.
      Returns:
      The current uinit measurement value representation desired.