Package ddf.measure
Enum Class Distance.LinearUnit
- All Implemented Interfaces:
Serializable,Comparable<Distance.LinearUnit>,Constable
- Enclosing class:
- Distance
Enumeration for the linear units supported by DDF.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic Distance.LinearUnitfromString(String enumValueString) Returns theDistance.LinearUnitenum constant corresponding to the string provided.static Distance.LinearUnitReturns the enum constant of this class with the specified name.static Distance.LinearUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
METER
-
KILOMETER
-
NAUTICAL_MILE
-
MILE
-
FOOT_U_S
-
YARD
-
-
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
-
fromString
Returns theDistance.LinearUnitenum constant corresponding to the string provided. It should be used as a replacement for the defaultvalueOf()method.This method supports all the string representations provided when the enum constants are created. As opposed to
valueOf(), this method is case-insensitive and will for instance work with nauticalmile, NAUTICALMILE and nauticalMile.- Parameters:
enumValueString- string representing the enum constant to return. Cannot benullor empty.- Returns:
- enum constant corresponding to the string representation provided
- Throws:
IllegalArgumentException- thrown if the string provided doesn't map to any enum constant, isnullor empty
-