public class Location extends java.lang.Object implements Locatable
Constructor and Description |
---|
Location(GeoCoord coord)
Instantiates a new location as a simple coordinate.
|
Location(GeoCoord coord,
double locRadius)
Instantiates a new location with a coordinate and radius
|
Location(java.lang.String placeName)
Instantiates a new location as a named entity.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj)
Return whether this object is equal to another object
|
GeoCoord |
getCenter()
Get the geographic center
|
java.lang.String |
getName()
Gets the name.
|
double |
getRadius()
Get the radius of the geographic entity.
|
int |
hashCode()
Return the hash code of the location, which is based upon the String
returned by toString()
|
void |
setCenter(GeoCoord coord)
Sets the center.
|
void |
setName(java.lang.String locName)
Sets the name.
|
void |
setRadius(double locRadius)
Set the radius of the geographic entity.
|
java.lang.String |
toString()
Return a string representation of this location
|
public Location(GeoCoord coord)
coord
- the coordinatepublic Location(GeoCoord coord, double locRadius)
coord
- the center coordinatelocRadius
- the radius of the location, in meterspublic Location(java.lang.String placeName)
placeName
- the place namepublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the object to comparepublic GeoCoord getCenter()
public java.lang.String getName()
public double getRadius()
public int hashCode()
hashCode
in class java.lang.Object
public void setCenter(GeoCoord coord)
coord
- the new center coordinatepublic void setName(java.lang.String locName)
locName
- the name of the locationpublic void setRadius(double locRadius)
locRadius
- the radius of the geographic entity, in meters.public java.lang.String toString()
toString
in class java.lang.Object