@Deprecated public enum DistanceUnits extends Enum<DistanceUnits>
| Enum Constant and Description |
|---|
KILOMETERS
Deprecated.
|
MILES
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
double |
convert(double distance,
DistanceUnits from)
Deprecated.
Converts the given distance in given DistanceUnit, to a distance in the unit represented by
this |
double |
earthCircumference()
Deprecated.
Returns the circumference of the Earth
|
double |
earthRadius()
Deprecated.
Returns the average earth radius
|
static DistanceUnits |
findDistanceUnit(String unit)
Deprecated.
Returns the DistanceUnit which represents the given unit
|
String |
getUnit()
Deprecated.
Returns the string representation of the distance unit
|
static DistanceUnits |
valueOf(String name)
Deprecated.
Returns the enum constant of this type with the specified name.
|
static DistanceUnits[] |
values()
Deprecated.
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final DistanceUnits MILES
public static final DistanceUnits KILOMETERS
public static DistanceUnits[] values()
for (DistanceUnits c : DistanceUnits.values()) System.out.println(c);
public static DistanceUnits valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant
with the specified nameNullPointerException - if the argument is nullpublic static DistanceUnits findDistanceUnit(String unit)
unit - Unit whose DistanceUnit should be foundIllegalArgumentException - if no DistanceUnit which represents the given unit is foundpublic double convert(double distance,
DistanceUnits from)
thisdistance - Distance to convertfrom - Unit to convert the distance frompublic String getUnit()
public double earthRadius()
public double earthCircumference()