Package ucar.nc2.dt.ugrid.utils
Enum AsaUnits.DistanceType
- java.lang.Object
-
- java.lang.Enum<AsaUnits.DistanceType>
-
- ucar.nc2.dt.ugrid.utils.AsaUnits.DistanceType
-
- All Implemented Interfaces:
Serializable,Comparable<AsaUnits.DistanceType>
- Enclosing class:
- AsaUnits
public static enum AsaUnits.DistanceType extends Enum<AsaUnits.DistanceType>
Enumeration used in converting between different distance units. Meters are used as a conversion base.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description FEETKILOMETERSMETERSMILESNAUTICAL_MILESUNKNOWN
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description doubleconvertFromMeters(double n)doubleconvertToMeters(double n)StringgetDisplayName()static AsaUnits.DistanceTypegetDistanceType(String string)StringtoString()static AsaUnits.DistanceTypevalueOf(String name)Returns the enum constant of this type with the specified name.static AsaUnits.DistanceType[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final AsaUnits.DistanceType UNKNOWN
-
METERS
public static final AsaUnits.DistanceType METERS
-
KILOMETERS
public static final AsaUnits.DistanceType KILOMETERS
-
MILES
public static final AsaUnits.DistanceType MILES
-
FEET
public static final AsaUnits.DistanceType FEET
-
NAUTICAL_MILES
public static final AsaUnits.DistanceType NAUTICAL_MILES
-
-
Method Detail
-
values
public static AsaUnits.DistanceType[] 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 (AsaUnits.DistanceType c : AsaUnits.DistanceType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AsaUnits.DistanceType valueOf(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:
IllegalArgumentException- if this enum type has no constant with the specified nameNullPointerException- if the argument is null
-
convertToMeters
public double convertToMeters(double n)
- Returns:
- the number of meters equal to
nwhennis in the units specified by this enumeration
-
convertFromMeters
public double convertFromMeters(double n)
- Returns:
- a number in the units specified by this enumeration equal to
nmeters
-
getDisplayName
public String getDisplayName()
-
toString
public String toString()
- Overrides:
toStringin classEnum<AsaUnits.DistanceType>
-
getDistanceType
public static AsaUnits.DistanceType getDistanceType(String string)
-
-