Package com.irurueta.units
Class UnitLocale
java.lang.Object
com.irurueta.units.UnitLocale
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic UnitSystemReturns unit system for default locale.static UnitSystemReturns unit system for provided locale.
-
Field Details
-
USA
USA ISO country code.- See Also:
-
LIBERIA
Liberia ISO country code.- See Also:
-
BURMA
Burma ISO country code.- See Also:
-
-
Constructor Details
-
UnitLocale
private UnitLocale()Constructor. Prevent instantiation of utility class.
-
-
Method Details
-
getDefault
Returns unit system for default locale.- Returns:
- unit system.
-
getFrom
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.
-