public class DistanceUnits extends Object
AbstractSpatialFieldType
Modifier and Type | Field and Description |
---|---|
static DistanceUnits |
BACKCOMPAT
Deprecated.
|
static DistanceUnits |
DEGREES |
static String |
DEGREES_PARAM |
static DistanceUnits |
KILOMETERS |
static String |
KILOMETERS_PARAM |
static DistanceUnits |
MILES |
static String |
MILES_PARAM |
Modifier and Type | Method and Description |
---|---|
static void |
addUnits(String strId,
double earthRadius,
double multiplierThisToDegrees)
Custom distance units can be supplied using this method.
|
double |
getEarthRadius() |
String |
getStringIdentifier() |
static Set<String> |
getSupportedUnits() |
double |
multiplierFromDegreesToThisUnit() |
double |
multiplierFromThisUnitToDegrees() |
String |
toString() |
static DistanceUnits |
valueOf(String str)
Parses a string representation of distance units and returns its implementing class instance.
|
public static final String KILOMETERS_PARAM
public static final String MILES_PARAM
public static final String DEGREES_PARAM
public static final DistanceUnits KILOMETERS
public static final DistanceUnits MILES
public static final DistanceUnits DEGREES
@Deprecated public static final DistanceUnits BACKCOMPAT
public static DistanceUnits valueOf(String str)
AbstractSpatialFieldType.parseDistanceUnits(String)
,
since it will default to one defined on the field type if the string is null.str
- String representation of distance units, e.g. "kilometers", "miles" etc. (null ok)public double getEarthRadius()
public double multiplierFromThisUnitToDegrees()
public double multiplierFromDegreesToThisUnit()
public String getStringIdentifier()
public static void addUnits(String strId, double earthRadius, double multiplierThisToDegrees)
strId
- string identifier for the unitsearthRadius
- radius of earth in supplied unitsmultiplierThisToDegrees
- multiplier to convert to degreesCopyright © 2000-2015 Apache Software Foundation. All Rights Reserved.