Package com.yahoo.prelude
Class Location
java.lang.Object
com.yahoo.prelude.Location
- All Implemented Interfaces:
Cloneable
Location data for a geographical query.
This is mutable and clonable. Its identity is decided by its content.
- Author:
- Steinar Knutsen, arnej27959
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordstatic final record -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()doubledegEW()Obtain degrees longitude (East-West direction); negative numbers are degrees West.doubledegNS()Obtain degrees latitude (North-South direction); negative numbers are degrees South.doubleObtain circle radius (in degrees).intencode(ByteBuffer buffer) Encodes the location to the given buffer and returns the length.booleanstatic LocationfromBoundingBox(Location.Point swCorner, Location.Point neCorner) static LocationfromGeoCircle(Location.Point center, double radius_in_degrees) Get the bounding box as a BoundingBox record.intReturns height of bounding box (actual height if rectangle, bounding square if circle).intReturns width of bounding box (actual width if rectangle, bounding square if circle).intbooleanbooleanbooleaninthashCode()booleancheck whether this Location contains a 2D circlevoidsetAttribute(String attributeName) voidsetBoundingBox(double n, double s, double e, double w) voidsetBoundingBox(Location.Point swCorner, Location.Point neCorner) voidsetDimensions(int d) voidsetGeoCircle(double ns, double ew, double radius_in_degrees) voidsetGeoCircle(Location.Point center, double radius_in_degrees) voidsetXyCircle(int px, int py, int radius_in_units) toString()
-
Constructor Details
-
Location
public Location() -
Location
-
-
Method Details
-
fromBoundingBox
-
fromGeoCircle
-
hasDimensions
public boolean hasDimensions() -
setDimensions
public void setDimensions(int d) -
getDimensions
public int getDimensions() -
setBoundingBox
public void setBoundingBox(double n, double s, double e, double w) -
setBoundingBox
-
setGeoCircle
-
setGeoCircle
public void setGeoCircle(double ns, double ew, double radius_in_degrees) -
setXyCircle
public void setXyCircle(int px, int py, int radius_in_units) -
toString
-
backendString
-
getBoundingWidth
public int getBoundingWidth()Returns width of bounding box (actual width if rectangle, bounding square if circle). -
getBoundingHeight
public int getBoundingHeight()Returns height of bounding box (actual height if rectangle, bounding square if circle). -
clone
-
equals
-
hashCode
public int hashCode() -
hasAttribute
public boolean hasAttribute() -
getAttribute
-
setAttribute
-
isGeoCircle
public boolean isGeoCircle()check whether this Location contains a 2D circle -
hasBoundingBox
public boolean hasBoundingBox() -
bbInDegrees
-
getBoundingBox
Get the bounding box as a BoundingBox record. May only be called when hasBoundingBox() returns true. -
degNS
public double degNS()Obtain degrees latitude (North-South direction); negative numbers are degrees South. Expected range is [-90.0,+90.0] only. May only be called when isGeoCircle() returns true. -
degEW
public double degEW()Obtain degrees longitude (East-West direction); negative numbers are degrees West. Expected range is [-180.0,+180.0] only. May only be called when isGeoCircle() returns true. -
degRadius
public double degRadius()Obtain circle radius (in degrees). Note that "no radius" or "infinite radius" is represented as -1. May only be called when isGeoCircle() returns true. -
encode
Encodes the location to the given buffer and returns the length. For internal use.
-