Package com.complexible.stardog.spatial
Enum DistanceUnit
- java.lang.Object
-
- java.lang.Enum<DistanceUnit>
-
- com.complexible.stardog.spatial.DistanceUnit
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<DistanceUnit>
public enum DistanceUnit extends java.lang.Enum<DistanceUnit>
The distance units for use with spatial queries
- Since:
- 4.0
- Version:
- 4.0
- Author:
- Michael Grove
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description double
convert(double theValue, DistanceUnit theUnit)
Convert the value in the given unit to this unitdouble
toCentimeters(double theDistance)
double
toDegrees(double theDistance)
Convert this distance to degreesdouble
toFeet(double theDistance)
double
toInches(double theDistance)
double
toKilometers(double theDistance)
Convert this distance to kilometersdouble
toMeters(double theDistance)
double
toMiles(double theDistance)
Convert this distance to milesdouble
toRadians(double theDistance)
double
toYards(double theDistance)
static DistanceUnit
valueOf(java.lang.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.
-
-
-
Enum Constant Detail
-
Inch
public static final DistanceUnit Inch
-
Foot
public static final DistanceUnit Foot
-
Yard
public static final DistanceUnit Yard
-
Mile
public static final DistanceUnit Mile
-
Radian
public static final DistanceUnit Radian
-
Degree
public static final DistanceUnit Degree
-
Centimeter
public static final DistanceUnit Centimeter
-
Meter
public static final DistanceUnit Meter
-
Kilometer
public static final DistanceUnit Kilometer
-
-
Method Detail
-
values
public static DistanceUnit[] 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 (DistanceUnit c : DistanceUnit.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DistanceUnit valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- 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
public double convert(double theValue, DistanceUnit theUnit)
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
-
-