Enum Class DistanceUnit

java.lang.Object
java.lang.Enum<DistanceUnit>
com.complexible.stardog.spatial.DistanceUnit
All Implemented Interfaces:
Serializable, Comparable<DistanceUnit>, Constable

public enum DistanceUnit extends Enum<DistanceUnit>

The distance units for use with spatial queries

Since:
4.0
Version:
4.0
Author:
Michael Grove
  • Enum Constant Details

  • Method Details

    • values

      public static DistanceUnit[] 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

      public static DistanceUnit valueOf(String name)
      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 name
      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 value
      theUnit - the unit of the value
      Returns:
      the value converted to this unit