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. It's identifty is decided by its content.
- Author:
- Steinar Knutsen, arnej27959
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
double
degEW()
Obtain degrees longitude (East-West direction); negative numbers are degrees West.double
degNS()
Obtain degrees latitude (North-South direction); negative numbers are degrees South.double
Obtain circle radius (in degrees).int
encode
(ByteBuffer buffer) Encodes the location to the given buffer and returns the length.boolean
int
Returns height of bounding box (actual height if rectangle, bounding square if circle)int
Returns width of bounding box (actual width if rectangle, bounding square if circle)int
boolean
boolean
boolean
int
hashCode()
boolean
check whether this Location contains a 2D circlevoid
setAttribute
(String attributeName) void
setBoundingBox
(double n, double s, double e, double w) void
setDimensions
(int d) void
setGeoCircle
(double ns, double ew, double radius_in_degrees) void
setXyCircle
(int px, int py, int radius_in_units) toString()
-
Constructor Details
-
Location
public Location() -
Location
-
-
Method Details
-
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) -
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)- Returns:
- width of bounding box
-
getBoundingHeight
public int getBoundingHeight()Returns height of bounding box (actual height if rectangle, bounding square if circle)- Returns:
- height of bounding box
-
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() -
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.
-