Package com.complexible.stardog.spatial
Enum Class DistanceUnit
- All Implemented Interfaces:
Serializable,Comparable<DistanceUnit>,Constable
The distance units for use with spatial queries
- Since:
- 4.0
- Version:
- 4.0
- Author:
- Michael Grove
-
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 TypeMethodDescriptiondoubleconvert(double theValue, DistanceUnit theUnit) Convert the value in the given unit to this unitdoubletoCentimeters(double theDistance) doubletoDegrees(double theDistance) Convert this distance to degreesdoubletoFeet(double theDistance) doubletoInches(double theDistance) doubletoKilometers(double theDistance) Convert this distance to kilometersdoubletoMeters(double theDistance) doubletoMiles(double theDistance) Convert this distance to milesdoubletoRadians(double theDistance) doubletoYards(double theDistance) static DistanceUnitReturns the enum constant of this class with the specified name.static DistanceUnit[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
Inch
-
Foot
-
Yard
-
Mile
-
Radian
-
Degree
-
Centimeter
-
Meter
-
Kilometer
-
-
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
-
toInches
public double toInches(double theDistance) -
toFeet
public double toFeet(double theDistance) -
toYards
public double toYards(double theDistance) -
toCentimeters
public double toCentimeters(double theDistance) -
toRadians
public double toRadians(double theDistance) -
toMeters
public double toMeters(double theDistance) -
toKilometers
public double toKilometers(double theDistance) Convert this distance to kilometers- Parameters:
theDistance- the distance- Returns:
- the distance in kilometers
-
toMiles
public double toMiles(double theDistance) Convert this distance to miles- Parameters:
theDistance- the distance- Returns:
- the distance in miles
-
toDegrees
public double toDegrees(double theDistance) Convert this distance to degrees- Parameters:
theDistance- the distance- Returns:
- the distance in degrees
-
convert
Convert the value in the given unit to this unit- Parameters:
theValue- the valuetheUnit- the unit of the value- Returns:
- the value converted to this unit
-