Enum Class DistanceUnit

java.lang.Object
java.lang.Enum<DistanceUnit>
org.deltava.beans.DistanceUnit
All Implemented Interfaces:
Serializable, Comparable<DistanceUnit>, Constable, ComboAlias, Unit

public enum DistanceUnit extends Enum<DistanceUnit> implements Unit
An enumeration to store units of distance.
Since:
5.0
Version:
6.0
Author:
Luke
  • Enum Constant Details

  • Method Details

    • values

      public static DistanceUnit[] 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 DistanceUnit 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
    • getUnitName

      public String getUnitName()
      Returns the unit name.
      Specified by:
      getUnitName in interface Unit
      Returns:
      the full name
    • getFactor

      public double getFactor()
      Returns the ratio of this distance unit to statute miles.
      Specified by:
      getFactor in interface Unit
      Returns:
      the ratio
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry