Class UnitLocale

java.lang.Object
com.irurueta.units.UnitLocale

public class UnitLocale extends Object
Helper class to determine the appropriate unit system for a given locale. Because detected unit system might not be 100% accurate, users should always have the option to specify their own unit system if the applications requires it.
  • Field Details

  • Constructor Details

    • UnitLocale

      private UnitLocale()
      Constructor. Prevent instantiation of utility class.
  • Method Details

    • getDefault

      public static UnitSystem getDefault()
      Returns unit system for default locale.
      Returns:
      unit system.
    • getFrom

      public static UnitSystem getFrom(Locale locale)
      Returns unit system for provided locale.
      Parameters:
      locale - a locale indicating at least a country, if no country is indicated then metric system will be assumed.
      Returns:
      unis system.