Enum Class SurfaceUnit

java.lang.Object
java.lang.Enum<SurfaceUnit>
com.irurueta.units.SurfaceUnit
All Implemented Interfaces:
Serializable, Comparable<SurfaceUnit>, Constable

public enum SurfaceUnit extends Enum<SurfaceUnit>
Enumerator containing recognized surface units.
  • Enum Constant Details

    • SQUARE_MILLIMETER

      public static final SurfaceUnit SQUARE_MILLIMETER
      Square millimeter (mm²).
    • SQUARE_CENTIMETER

      public static final SurfaceUnit SQUARE_CENTIMETER
      Square centimeter (cm²).
    • SQUARE_METER

      public static final SurfaceUnit SQUARE_METER
      Square meter (m²).
    • SQUARE_KILOMETER

      public static final SurfaceUnit SQUARE_KILOMETER
      Square kilometer (Km²).
    • SQUARE_INCH

      public static final SurfaceUnit SQUARE_INCH
      Square inch (sq in).
    • SQUARE_FOOT

      public static final SurfaceUnit SQUARE_FOOT
      Square foot (sq ft).
    • SQUARE_YARD

      public static final SurfaceUnit SQUARE_YARD
      Square yard (sq yd).
    • SQUARE_MILE

      public static final SurfaceUnit SQUARE_MILE
      Square mile (sq mi).
    • CENTIARE

      public static final SurfaceUnit CENTIARE
      Centiare (ca).
    • ARE

      public static final SurfaceUnit ARE
      Are (a).
    • DECARE

      public static final SurfaceUnit DECARE
      Decare (daa).
    • HECTARE

      public static final SurfaceUnit HECTARE
      Hectare (ha).
    • ACRE

      public static final SurfaceUnit ACRE
      Acre (acre).
  • Constructor Details

    • SurfaceUnit

      private SurfaceUnit()
  • Method Details

    • values

      public static SurfaceUnit[] 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

      public static SurfaceUnit valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getUnitSystem

      public static UnitSystem getUnitSystem(SurfaceUnit unit)
      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

      public static SurfaceUnit[] getMetricUnits()
      Gets all supported metric surface units.
      Returns:
      all supported metric surface units.
    • getImperialUnits

      public static SurfaceUnit[] getImperialUnits()
      Gets all supported imperial distance units.
      Returns:
      all supported imperial distance units.
    • isMetric

      public static boolean isMetric(SurfaceUnit unit)
      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

      public static boolean isImperial(SurfaceUnit unit)
      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.