Package com.attivio.sdk.search.fields
Class GeoDistance
- java.lang.Object
-
- com.attivio.sdk.search.fields.FieldExpression
-
- com.attivio.sdk.search.fields.UnaryFieldExpression
-
- com.attivio.sdk.search.fields.GeoDistance
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class GeoDistance extends UnaryFieldExpression
Computes the geographical distance from a center point.- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.attivio.sdk.search.fields.FieldExpression
FieldExpression.StringMode
-
-
Field Summary
Fields Modifier and Type Field Description static DistanceUnits
DEFAULT_DISTANCE_UNITS
-
Fields inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
expression
-
Fields inherited from class com.attivio.sdk.search.fields.FieldExpression
EMPTY_ARRAY
-
-
Constructor Summary
Constructors Constructor Description GeoDistance(FieldExpression expression, double latitude, double longitude)
Construct a new FieldFunction to apply an aggregation function to another expression.GeoDistance(FieldExpression expression, double latitude, double longitude, DistanceUnits distanceUnits)
Construct a new FieldFunction to apply an aggregation function to another expression.GeoDistance(java.lang.String fieldName, double latitude, double longitude)
Calculate the geo distance.GeoDistance(java.lang.String fieldName, Point center, DistanceUnits units)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description GeoDistance
clone()
protected GeoDistance
clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.boolean
equals(java.lang.Object other)
DistanceUnits
getDistanceUnits()
Get the units the distance will be returned in (meters, kilometers, etc)double
getLatitude()
Get the center latitude to calculate distance to.double
getLongitude()
Get the center longitude to calculate distance to.SchemaField.Type
getType(Schema schema)
Resolve the type for this expression.int
hashCode()
void
setDistanceUnits(DistanceUnits units)
Get the units the distance will be returned in (meters, kilometers, etc)void
setLatitude(double latitude)
Set the center latitude to calculate distance to.void
setLongitude(double longitude)
Set the center longitude to calculate distance to.protected void
toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.static GeoDistance
valueOf(StringParser reader)
-
Methods inherited from class com.attivio.sdk.search.fields.UnaryFieldExpression
forEachField, getExpression, getFieldName, hasChildren, isConstant, rewrite, setExpression
-
Methods inherited from class com.attivio.sdk.search.fields.FieldExpression
apply, copyOf, forEachPhrase, forEachQuery, getDefaultName, isConstant, parse, quote, rewrite, rewriteChildren, toString, toString, valueOf
-
-
-
-
Field Detail
-
DEFAULT_DISTANCE_UNITS
public static final DistanceUnits DEFAULT_DISTANCE_UNITS
-
-
Constructor Detail
-
GeoDistance
public GeoDistance(java.lang.String fieldName, Point center, DistanceUnits units)
-
GeoDistance
public GeoDistance(java.lang.String fieldName, double latitude, double longitude)
Calculate the geo distance.
-
GeoDistance
public GeoDistance(FieldExpression expression, double latitude, double longitude)
Construct a new FieldFunction to apply an aggregation function to another expression.
-
GeoDistance
public GeoDistance(FieldExpression expression, double latitude, double longitude, DistanceUnits distanceUnits)
Construct a new FieldFunction to apply an aggregation function to another expression.
-
-
Method Detail
-
getType
public SchemaField.Type getType(Schema schema)
Resolve the type for this expression.- Specified by:
getType
in classFieldExpression
-
getDistanceUnits
public DistanceUnits getDistanceUnits()
Get the units the distance will be returned in (meters, kilometers, etc)
-
setDistanceUnits
public void setDistanceUnits(DistanceUnits units)
Get the units the distance will be returned in (meters, kilometers, etc)
-
getLatitude
public double getLatitude()
Get the center latitude to calculate distance to.
-
setLatitude
public void setLatitude(double latitude)
Set the center latitude to calculate distance to.
-
getLongitude
public double getLongitude()
Get the center longitude to calculate distance to.
-
setLongitude
public void setLongitude(double longitude)
Set the center longitude to calculate distance to.
-
toString
protected void toString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)
Writes the string representation of this field expression tobuffer
.- Specified by:
toString
in classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classUnaryFieldExpression
-
clone
public GeoDistance clone()
- Overrides:
clone
in classUnaryFieldExpression
-
clone
protected GeoDistance clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.- Overrides:
clone
in classUnaryFieldExpression
-
valueOf
public static GeoDistance valueOf(StringParser reader)
-
-