public final class GeoLocation extends Object
<geoloc/> element in the http://jabber.org/protocol/geoloc namespace.
This class represents the geological location of a user.
Location information about human users SHOULD be communicated and transported by means of Publish-Subscribe (XEP-0060) [5] or the subset thereof specified in Personal Eventing Protocol (XEP-0163) [6].
Although the XMPP publish-subscribe extension is the preferred means for transporting location information about human users, applications that do not involve human users (e.g., device tracking) MAY use other transport methods; however, because location information is not pure presence information and can change independently of network availability, it SHOULD NOT be provided as an extension to
<presence/>.
GeoLocation geoLocation = GeoLocation.builder()
.countryCode("de")
.latitude(50.2)
.longitude(7.5)
.timeZone(TimeZone.getTimeZone("GMT+1"))
.build();
| Modifier and Type | Class and Description |
|---|---|
static class |
GeoLocation.Builder
A builder class to which builds geo location objects.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
NAMESPACE
http://jabber.org/protocol/geoloc
|
| Constructor and Description |
|---|
GeoLocation()
Creates an empty geolocation element.
|
GeoLocation(double latitude,
double longitude)
Deprecated.
Use the builder to create an instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
static GeoLocation.Builder |
builder()
Creates the builder to build a geo location.
|
Double |
getAccuracy()
Gets the horizontal GPS error in meters.
|
Double |
getAltitude()
Gets the altitude in meters above or below sea level.
|
String |
getArea()
Gets a named area such as a campus or neighborhood.
|
Double |
getBearing()
Gets the GPS bearing (direction in which the entity is heading to reach its next waypoint), measured in decimal degrees relative to true north.
|
String |
getBuilding()
Gets a specific building on a street or in an area.
|
String |
getCountry()
Gets the nation where the user is located.
|
String |
getCountryCode()
Gets the ISO 3166 two-letter country code.
|
String |
getDatum()
Gets the GPS datum.
|
String |
getDescription()
Gets a natural-language name for or description of the location.
|
String |
getFloor()
Gets a particular floor in a building.
|
String |
getLanguage()
Gets the the natural language of location data.
|
Double |
getLatitude()
Gets the latitude in decimal degrees North.
|
String |
getLocality()
Gets a locality within the administrative region, such as a town or city.
|
Double |
getLongitude()
Gets the longitude in decimal degrees East.
|
String |
getPostalCode()
Gets a code used for postal delivery.
|
String |
getRegion()
Gets an administrative region of the nation, such as a state or province.
|
String |
getRoom()
Gets a particular room in a building.
|
Double |
getSpeed()
Gets the speed at which the entity is moving, in meters per second.
|
String |
getStreet()
Gets a thoroughfare within the locality, or a crossing of two thoroughfares.
|
String |
getText()
Gets a catch-all element that captures any other information about the location.
|
Date |
getTimestamp()
Gets the UTC timestamp specifying the moment when the reading was taken.
|
TimeZone |
getTimeZone()
Gets the time zone offset from UTC for the current location.
|
URI |
getUri()
Gets a URI or URL pointing to information about the location.
|
void |
setAccuracy(Double accuracy)
Deprecated.
Use
GeoLocation.Builder. |
void |
setAltitude(Double altitude)
Deprecated.
Use
GeoLocation.Builder. |
void |
setArea(String area)
Deprecated.
Use
GeoLocation.Builder. |
void |
setBearing(Double bearing)
Deprecated.
Use
GeoLocation.Builder. |
void |
setBuilding(String building)
Deprecated.
Use
GeoLocation.Builder. |
void |
setCountry(String country)
Deprecated.
Use
GeoLocation.Builder. |
void |
setCountryCode(String countryCode)
Deprecated.
Use
GeoLocation.Builder. |
void |
setDatum(String datum)
Deprecated.
Use
GeoLocation.Builder. |
void |
setDescription(String description)
Deprecated.
Use
GeoLocation.Builder. |
void |
setFloor(String floor)
Deprecated.
Use
GeoLocation.Builder. |
void |
setLanguage(String language)
Deprecated.
Use
GeoLocation.Builder. |
void |
setLatitude(Double latitude)
Deprecated.
Use
GeoLocation.Builder. |
void |
setLocality(String locality)
Deprecated.
Use
GeoLocation.Builder. |
void |
setLongitude(Double longitude)
Deprecated.
Use
GeoLocation.Builder. |
void |
setPostalCode(String postalCode)
Deprecated.
Use
GeoLocation.Builder. |
void |
setRegion(String region)
Deprecated.
Use
GeoLocation.Builder. |
void |
setRoom(String room)
Deprecated.
Use
GeoLocation.Builder. |
void |
setSpeed(Double speed)
Deprecated.
Use
GeoLocation.Builder. |
void |
setStreet(String street)
Deprecated.
Use
GeoLocation.Builder. |
void |
setText(String text)
Deprecated.
Use
GeoLocation.Builder. |
void |
setTimestamp(Date timestamp)
Deprecated.
Use
GeoLocation.Builder. |
void |
setTimeZone(TimeZone timeZone)
Deprecated.
Use
GeoLocation.Builder. |
void |
setUri(URI uri)
Deprecated.
Use
GeoLocation.Builder. |
String |
toString() |
public static final String NAMESPACE
public GeoLocation()
@Deprecated public GeoLocation(double latitude, double longitude)
latitude - The latitude.longitude - The longitude.public static GeoLocation.Builder builder()
public final Double getAccuracy()
setAccuracy(Double)@Deprecated public void setAccuracy(Double accuracy)
GeoLocation.Builder.accuracy - The accuracy.getAccuracy()public final Double getAltitude()
setAltitude(Double)@Deprecated public void setAltitude(Double altitude)
GeoLocation.Builder.altitude - The altitude.getAltitude()public final String getArea()
setArea(String)@Deprecated public void setArea(String area)
GeoLocation.Builder.area - The area.getArea()public final Double getBearing()
setBearing(Double)@Deprecated public void setBearing(Double bearing)
GeoLocation.Builder.bearing - The bearing.getBearing()public final String getBuilding()
setBuilding(String)@Deprecated public void setBuilding(String building)
GeoLocation.Builder.building - The building.getBuilding()public final String getCountry()
setCountry(String)@Deprecated public void setCountry(String country)
GeoLocation.Builder.country - The country.getCountry()public final String getCountryCode()
setCountryCode(String)@Deprecated public void setCountryCode(String countryCode)
GeoLocation.Builder.countryCode - The country code.getCountryCode()public final String getDatum()
setDatum(String)@Deprecated public void setDatum(String datum)
GeoLocation.Builder.datum - The GPS datum.getDatum()public final String getDescription()
setDescription(String)@Deprecated public void setDescription(String description)
GeoLocation.Builder.description - The description.getDescription()public final String getFloor()
setFloor(String)@Deprecated public void setFloor(String floor)
GeoLocation.Builder.floor - The floor.getFloor()public final Double getLatitude()
setLatitude(Double)@Deprecated public void setLatitude(Double latitude)
GeoLocation.Builder.latitude - The latitude.getLatitude()public final String getLocality()
setLocality(String)@Deprecated public void setLocality(String locality)
GeoLocation.Builder.locality - The locality.getLocality()public final Double getLongitude()
setLongitude(Double)@Deprecated public void setLongitude(Double longitude)
GeoLocation.Builder.longitude - The longitude.getLongitude()public final String getPostalCode()
setPostalCode(String)@Deprecated public void setPostalCode(String postalCode)
GeoLocation.Builder.postalCode - The postal code.getPostalCode()public final String getRegion()
setRegion(String)@Deprecated public void setRegion(String region)
GeoLocation.Builder.region - The region.getRegion()public final String getRoom()
setRoom(String)@Deprecated public void setRoom(String room)
GeoLocation.Builder.room - The room.getRoom()public final Double getSpeed()
setSpeed(Double)@Deprecated public void setSpeed(Double speed)
GeoLocation.Builder.speed - The speed.getSpeed()public final String getStreet()
setStreet(String)@Deprecated public void setStreet(String street)
GeoLocation.Builder.street - The street.setStreet(String)public final String getText()
setText(String)@Deprecated public void setText(String text)
GeoLocation.Builder.text - The text.getText()public final Date getTimestamp()
setTimestamp(java.util.Date)@Deprecated public void setTimestamp(Date timestamp)
GeoLocation.Builder.timestamp - The timestamp.getTimestamp()public final URI getUri()
setUri(java.net.URI)@Deprecated public void setUri(URI uri)
GeoLocation.Builder.uri - The URI.getUri()public final String getLanguage()
setLanguage(String)@Deprecated public void setLanguage(String language)
GeoLocation.Builder.language - The language.getLanguage()public final TimeZone getTimeZone()
@Deprecated public void setTimeZone(TimeZone timeZone)
GeoLocation.Builder.timeZone - The time zone.Copyright © 2014–2015 XMPP.rocks. All rights reserved.