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 DistanceUnitsDEFAULT_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 GeoDistanceclone()protected GeoDistanceclone(FieldExpression e)Create a new instance of this FieldExpression, with a different argument.booleanequals(java.lang.Object other)DistanceUnitsgetDistanceUnits()Get the units the distance will be returned in (meters, kilometers, etc)doublegetLatitude()Get the center latitude to calculate distance to.doublegetLongitude()Get the center longitude to calculate distance to.SchemaField.TypegetType(Schema schema)Resolve the type for this expression.inthashCode()voidsetDistanceUnits(DistanceUnits units)Get the units the distance will be returned in (meters, kilometers, etc)voidsetLatitude(double latitude)Set the center latitude to calculate distance to.voidsetLongitude(double longitude)Set the center longitude to calculate distance to.protected voidtoString(java.lang.StringBuilder buffer, FieldExpression.StringMode mode)Writes the string representation of this field expression tobuffer.static GeoDistancevalueOf(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:
getTypein 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:
toStringin classFieldExpression
-
hashCode
public int hashCode()
- Overrides:
hashCodein classUnaryFieldExpression
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classUnaryFieldExpression
-
clone
public GeoDistance clone()
- Overrides:
clonein classUnaryFieldExpression
-
clone
protected GeoDistance clone(FieldExpression e)
Create a new instance of this FieldExpression, with a different argument.- Overrides:
clonein classUnaryFieldExpression
-
valueOf
public static GeoDistance valueOf(StringParser reader)
-
-