|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||
java.lang.Objectjava.lang.Enum<DistanceUnits>
org.apache.lucene.spatial.geometry.DistanceUnits
public enum DistanceUnits
Enum representing difference distance units, currently only kilometers and miles
| Enum Constant Summary | |
|---|---|
KILOMETERS
|
|
MILES
|
|
| Method Summary | |
|---|---|
double |
convert(double distance,
DistanceUnits from)
Converts the given distance in given DistanceUnit, to a distance in the unit represented by this |
double |
earthCircumference()
Returns the circumference of the Earth |
double |
earthRadius()
Returns the average earth radius |
static DistanceUnits |
findDistanceUnit(String unit)
Returns the DistanceUnit which represents the given unit |
String |
getUnit()
Returns the string representation of the distance unit |
static DistanceUnits |
valueOf(String name)
Returns the enum constant of this type with the specified name. |
static DistanceUnits[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
| Methods inherited from class java.lang.Enum |
|---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Enum Constant Detail |
|---|
public static final DistanceUnits MILES
public static final DistanceUnits KILOMETERS
| Method Detail |
|---|
public static DistanceUnits[] values()
for (DistanceUnits c : DistanceUnits.values()) System.out.println(c);
public static DistanceUnits valueOf(String name)
name - the name of the enum constant to be returned.
IllegalArgumentException - if this enum type has no constant
with the specified name
NullPointerException - if the argument is nullpublic static DistanceUnits findDistanceUnit(String unit)
unit - Unit whose DistanceUnit should be found
IllegalArgumentException - if no DistanceUnit which represents the given unit is found
public double convert(double distance,
DistanceUnits from)
this
distance - Distance to convertfrom - Unit to convert the distance from
public String getUnit()
public double earthRadius()
public double earthCircumference()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD | |||||||||