Enum DistanceUnit

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<DistanceUnit>

    @StableMinor(version="16.0",
                 sinceVersion="9.0")
    public enum DistanceUnit
    extends java.lang.Enum<DistanceUnit>
    Distance units.
    Since:
    9.0.0
    Version:
    $Revision: 25808 $ $Date: 2023-07-04 15:20:55 -0300 (Tue, 04 Jul 2023) $
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static DistanceUnit valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static DistanceUnit[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • MILE

        public static final DistanceUnit MILE
        Mile.
        Since:
        9.0.0
      • YARD

        public static final DistanceUnit YARD
        Yard.
        Since:
        9.0.0
      • FEET

        public static final DistanceUnit FEET
        Feet.
        Since:
        9.0.0
      • INCH

        public static final DistanceUnit INCH
        Inch.
        Since:
        9.0.0
      • KILOMETER

        public static final DistanceUnit KILOMETER
        Kilometer.
        Since:
        9.0.0
      • METER

        public static final DistanceUnit METER
        Meter.
        Since:
        9.0.0
      • CENTIMETER

        public static final DistanceUnit CENTIMETER
        Centimeter.
        Since:
        9.0.0
      • MILLIMETER

        public static final DistanceUnit MILLIMETER
        Millimeter.
        Since:
        9.0.0
      • NAUTICAL_MILE

        public static final DistanceUnit NAUTICAL_MILE
        Nautical mile.
        Since:
        9.0.0
    • Method Detail

      • values

        public static DistanceUnit[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DistanceUnit c : DistanceUnit.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DistanceUnit valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null