Package com.irurueta.units
Enum Class SurfaceUnit
- All Implemented Interfaces:
Serializable,Comparable<SurfaceUnit>,Constable
Enumerator containing recognized surface units.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionAcre (acre).Are (a).Centiare (ca).Decare (daa).Hectare (ha).Square centimeter (cm²).Square foot (sq ft).Square inch (sq in).Square kilometer (Km²).Square meter (m²).Square mile (sq mi).Square millimeter (mm²).Square yard (sq yd). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SurfaceUnit[]Gets all supported imperial distance units.static SurfaceUnit[]Gets all supported metric surface units.static UnitSystemgetUnitSystem(SurfaceUnit unit) Returns unit system for provided surface unit.static booleanisImperial(SurfaceUnit unit) Indicates whether provided unit belongs to the imperial unit system.static booleanisMetric(SurfaceUnit unit) Indicates whether provided unit belongs to the metric unit system.static SurfaceUnitReturns the enum constant of this class with the specified name.static SurfaceUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SQUARE_MILLIMETER
Square millimeter (mm²). -
SQUARE_CENTIMETER
Square centimeter (cm²). -
SQUARE_METER
Square meter (m²). -
SQUARE_KILOMETER
Square kilometer (Km²). -
SQUARE_INCH
Square inch (sq in). -
SQUARE_FOOT
Square foot (sq ft). -
SQUARE_YARD
Square yard (sq yd). -
SQUARE_MILE
Square mile (sq mi). -
CENTIARE
Centiare (ca). -
ARE
Are (a). -
DECARE
Decare (daa). -
HECTARE
Hectare (ha). -
ACRE
Acre (acre).
-
-
Constructor Details
-
SurfaceUnit
private SurfaceUnit()
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getUnitSystem
Returns unit system for provided surface unit.- Parameters:
unit- surface unit to be checked.- Returns:
- unit system (metric or imperial).
- Throws:
IllegalArgumentException- if unit is null or not supported.
-
getMetricUnits
Gets all supported metric surface units.- Returns:
- all supported metric surface units.
-
getImperialUnits
Gets all supported imperial distance units.- Returns:
- all supported imperial distance units.
-
isMetric
Indicates whether provided unit belongs to the metric unit system.- Parameters:
unit- distance unit to be checked.- Returns:
- true if unit belongs to metric unit system.
- Throws:
IllegalArgumentException- if unit is null or not supported.
-
isImperial
Indicates whether provided unit belongs to the imperial unit system.- Parameters:
unit- distance unit to be checked.- Returns:
- true if unit belongs to imperial unit system.
- Throws:
IllegalArgumentException- if unit is null or not supported.
-