public enum DistanceUnit extends Enum<DistanceUnit>
METERS
which is defined by DEFAULT
Modifier and Type | Class and Description |
---|---|
static class |
DistanceUnit.Distance |
static class |
DistanceUnit.GeoDistance |
Enum Constant and Description |
---|
CENTIMETERS |
FEET |
INCH |
KILOMETERS |
METERS |
MILES |
MILLIMETERS |
NAUTICALMILES |
YARD |
Modifier and Type | Field and Description |
---|---|
static DistanceUnit |
DEFAULT |
Modifier and Type | Method and Description |
---|---|
static double |
convert(double distance,
DistanceUnit from,
DistanceUnit to)
Converts the given distance from the given DistanceUnit, to the given DistanceUnit
|
double |
getMeters() |
String[] |
getNames() |
static DistanceUnit.Distance |
parseDistance(String distance)
Parse a
DistanceUnit.Distance from a given String |
String |
toString() |
String |
toString(double distance)
Convert a value to a distance string
|
static DistanceUnit |
valueOf(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.
|
public static final DistanceUnit INCH
public static final DistanceUnit YARD
public static final DistanceUnit FEET
public static final DistanceUnit KILOMETERS
public static final DistanceUnit NAUTICALMILES
public static final DistanceUnit MILLIMETERS
public static final DistanceUnit CENTIMETERS
public static final DistanceUnit MILES
public static final DistanceUnit METERS
public static final DistanceUnit DEFAULT
public static DistanceUnit[] values()
for (DistanceUnit c : DistanceUnit.values()) System.out.println(c);
public static DistanceUnit 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 double getMeters()
public String toString(double distance)
distance
- value to convertpublic String toString()
toString
in class Enum<DistanceUnit>
public static DistanceUnit.Distance parseDistance(String distance)
DistanceUnit.Distance
from a given Stringdistance
- String defining a DistanceUnit.Distance
DistanceUnit.Distance
public static double convert(double distance, DistanceUnit from, DistanceUnit to)
distance
- Distance to convertfrom
- Unit to convert the distance fromto
- Unit of distance to convert toCopyright © 2024 Global Biodiversity Information Facility (GBIF). All rights reserved.