Class UnitsConverter

java.lang.Object
com.ibm.icu.impl.units.UnitsConverter

public class UnitsConverter extends Object
  • Field Details

    • conversionRate

      private BigDecimal conversionRate
    • reciprocal

      private boolean reciprocal
    • offset

      private BigDecimal offset
    • specialSource

      private String specialSource
    • specialTarget

      private String specialTarget
    • minMetersPerSecForBeaufort

      private static final BigDecimal[] minMetersPerSecForBeaufort
  • Constructor Details

    • UnitsConverter

      public UnitsConverter(String sourceIdentifier, String targetIdentifier)
      Constructor of UnitsConverter. NOTE: - source and target must be under the same category - e.g. meter to mile --> both of them are length units.

      NOTE: This constructor creates an instance of UnitsConverter internally.

      Parameters:
      sourceIdentifier - represents the source unit identifier.
      targetIdentifier - represents the target unit identifier.
    • UnitsConverter

      public UnitsConverter(MeasureUnitImpl source, MeasureUnitImpl target, ConversionRates conversionRates)
      Constructor of UnitsConverter. NOTE: - source and target must be under the same category - e.g. meter to mile --> both of them are length units. This converts from source to base to target (one of those may be a no-op).
      Parameters:
      source - represents the source unit.
      target - represents the target unit.
      conversionRates - contains all the needed conversion rates.
  • Method Details