public enum GeoDistance extends java.lang.Enum<GeoDistance> implements Writeable
Writeable.Reader<V>, Writeable.Writer<V>| Modifier and Type | Method and Description |
|---|---|
double |
calculate(double srcLat,
double srcLon,
double dstLat,
double dstLon,
DistanceUnit unit)
compute the distance between two points using the selected algorithm (PLANE, ARC)
|
static GeoDistance |
fromString(java.lang.String name)
Get a
GeoDistance according to a given name. |
static GeoDistance |
readFromStream(StreamInput in)
Creates a GeoDistance instance from an input stream
|
static GeoDistance |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static GeoDistance[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
void |
writeTo(StreamOutput out)
Writes an instance of a GeoDistance object to an output stream
|
public static final GeoDistance PLANE
public static final GeoDistance ARC
public static GeoDistance[] values()
for (GeoDistance c : GeoDistance.values()) System.out.println(c);
public static GeoDistance valueOf(java.lang.String name)
name - the name of the enum constant to be returned.java.lang.IllegalArgumentException - if this enum type has no constant with the specified namejava.lang.NullPointerException - if the argument is nullpublic static GeoDistance readFromStream(StreamInput in) throws java.io.IOException
java.io.IOExceptionpublic void writeTo(StreamOutput out) throws java.io.IOException
public static GeoDistance fromString(java.lang.String name)
GeoDistance according to a given name. Valid values are
GeoDistance.PLANEGeoDistance.ARCname - name of the GeoDistanceGeoDistancepublic double calculate(double srcLat,
double srcLon,
double dstLat,
double dstLon,
DistanceUnit unit)