Sequenceablepublic class GeoAddress extends Object implements Sequenceable
A geographic location consists of some parameters of an eXtensible Address Language (xAL) address, such as the longitude, latitude, country code, and administrative region name.
SequenceableSequenceable.Producer<T>| 构造器 | 说明 |
|---|---|
GeoAddress(Locale locale) |
Creates a
GeoAddress object. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
void |
clearLatitude() |
Clears the latitude information in the current
GeoAddress object. |
void |
clearLongitude() |
Clears the longitude information in the current
GeoAddress object. |
String |
getAddressUrl() |
Obtains the website URL in the current
GeoAddress object, for example,
the official website of a company. |
String |
getAdministrativeArea() |
Obtains the administrative region name of the current
GeoAddress object, for example,
Hong Kong (China) and California. |
String |
getCountryCode() |
Obtains the country code of the current
GeoAddress object, for example, EN. |
String |
getCountryName() |
Obtains the country name of the current
GeoAddress object, for example, China. |
String |
getDescriptions(int index) |
Obtains the description identified by a specified index.
|
int |
getDescriptionsSize() |
Obtains the total number of descriptions in the current
GeoAddress object. |
double |
getLatitude() |
Obtains the latitude in the current
GeoAddress object. |
Locale |
getLocale() |
Obtains the locale information, such as the country code, country name, and language,
of the current
GeoAddress object. |
String |
getLocality() |
Obtains the locality of the current
GeoAddress object, such as Beijing or New York. |
double |
getLongitude() |
Obtains the longitude in the current
GeoAddress object. |
String |
getPhoneNumber() |
Obtains the phone number in the current
GeoAddress object. |
String |
getPlaceName() |
Obtains the landmark in the current
GeoAddress object, for example, Eiffel Tower. |
String |
getPostalCode() |
Obtains the postal code in the current
GeoAddress object. |
String |
getPremises() |
Obtains the house information in the current
GeoAddress object, such as the house number. |
String |
getRoadName() |
Obtains the road name in the current
GeoAddress object. |
String |
getSubAdministrativeArea() |
Obtains sub-administrative region name of the current
GeoAddress object. |
String |
getSubLocality() |
Obtains the sub-locality in the current
GeoAddress object. |
String |
getSubRoadName() |
Obtains auxiliary road information in the current
GeoAddress object, for example, the road ID. |
boolean |
hasLatitude() |
Checks whether the current
GeoAddress object contains valid latitude information. |
boolean |
hasLongitude() |
Checks whether the current
GeoAddress object contains valid longitude information. |
boolean |
marshalling(Parcel out) |
Marshalls a
GeoAddress object into a parcel. |
void |
setAddressUrl(String url) |
Sets the website URL of the current
GeoAddress object. |
void |
setAdministrativeArea(String adminArea) |
Sets the administrative region name of the current
GeoAddress object. |
void |
setCountryCode(String countryCode) |
Sets the country code of the current
GeoAddress object. |
void |
setCountryName(String countryName) |
Sets the country name of the current
GeoAddress object. |
void |
setDescriptions(int index,
String description) |
Sets the description identified by a specified index on the address list.
|
void |
setLatitude(double latitude) |
Sets the latitude in the current
GeoAddress object. |
void |
setLocality(String locality) |
Sets the locality in the current
GeoAddress object. |
void |
setLongitude(double longitude) |
Sets the longitude in the current
GeoAddress object. |
void |
setPhoneNumber(String phone) |
Sets the phone number in the current
GeoAddress object. |
void |
setPlaceName(String placeName) |
Sets the landmark in the current
GeoAddress object. |
void |
setPostalCode(String postalCode) |
Sets the postal code in the current
GeoAddress object. |
void |
setPremises(String premises) |
Sets house information in the current
GeoAddress object, such as the house number. |
void |
setRoadName(String road) |
Sets the road name in the current
GeoAddress object. |
void |
setSubAdministrativeArea(String subAdminArea) |
Sets the sub-administrative region name of the current
GeoAddress object. |
void |
setSubLocality(String subLocality) |
Sets the sub-locality in the current
GeoAddress object. |
void |
setSubRoadName(String subRoad) |
Sets auxiliary road information in the current
GeoAddress object, for example, the road ID. |
String |
toString() |
Concatenates the data values of the current
GeoAddress object into a character string. |
boolean |
unmarshalling(Parcel in) |
Unmarshalls a
GeoAddress object and updates its data. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waithasFileDescriptorpublic GeoAddress(Locale locale)
GeoAddress object.
Specifically, this method uses a Locale object as the input parameter to create
a GeoAddress object. For the default values of various data fields, see the respective get method.
locale - Specifies the locale configuration. The value can be null if unknown.public Locale getLocale()
GeoAddress object.GeoAddress object.public int getDescriptionsSize()
GeoAddress object.
A GeoAddress object may have multiple descriptions.
You can use this method to obtain the total number of descriptions.
public String getDescriptions(int index)
Descriptions in the GeoAddress object are numbered from 0.
The maximum number of descriptions is equal to the value set by getDescriptionsSize() minus 1.
If the obtained index is smaller than 0 or greater than the maximum number, the value is null, indicating
that no matching index has been found.
index - Specifies the index of the description, which must be greater than or equal to 0.public void setDescriptions(int index,
String description)
throws IllegalArgumentException
Descriptions in the GeoAddress object are numbered from 0.
You can modify a description identified by a specified index or append a description to the existing
list. The index of the newly added description is equal to the number of descriptions obtained by
getDescriptionsSize().
index - Specifies the index of the description. The value must be greater than or equal to 0
and less than or equal to the total number of descriptions obtained by getDescriptionsSize().description - Specifies a description. The value can be null if unknown.IllegalArgumentException - Throws this exception if the specified index is smaller than 0
or greater than the total number of descriptions obtained by getDescriptionsSize().public String getPlaceName()
GeoAddress object, for example, Eiffel Tower.GeoAddress object. The value is null if no landmark exists.public void setPlaceName(String placeName)
GeoAddress object.placeName - Specifies the landmark. The value can be null if unknown.public String getAdministrativeArea()
GeoAddress object, for example,
Hong Kong (China) and California.GeoAddress object.
The value is null if no administrative region name exists.public void setAdministrativeArea(String adminArea)
GeoAddress object.adminArea - Specifies the administrative region name. The value can be null if unknown.public String getSubAdministrativeArea()
GeoAddress object.GeoAddress object.
The value is null if no sub-administrative region name exists.public void setSubAdministrativeArea(String subAdminArea)
GeoAddress object.subAdminArea - Specifies the sub-administrative region name. The value can be null if unknown.public String getLocality()
GeoAddress object, such as Beijing or New York.GeoAddress object. The value is null if no locality exists.public void setLocality(String locality)
GeoAddress object.locality - Specifies the locality. The value can be null if unknown.public String getSubLocality()
GeoAddress object.GeoAddress object.
The value is null if no sub-locality exists.public void setSubLocality(String subLocality)
GeoAddress object.subLocality - Specifies the sub-locality. The value can be null if unknown.public String getRoadName()
GeoAddress object.GeoAddress object.
The value is null if no road name exists.public void setRoadName(String road)
GeoAddress object.road - Specifies the road name. The value can be null if unknown.public String getSubRoadName()
GeoAddress object, for example, the road ID.GeoAddress object.
The value is null if no auxiliary road information exists.public void setSubRoadName(String subRoad)
GeoAddress object, for example, the road ID.subRoad - Specifies the auxiliary road information. The value can be null if unknown.public String getPremises()
GeoAddress object, such as the house number.GeoAddress object.
The value is null if no house information exists.public void setPremises(String premises)
GeoAddress object, such as the house number.premises - Specifies the house information. The value can be null if unknown.public String getPostalCode()
GeoAddress object.GeoAddress object.
The value is null if no postal code exists.public void setPostalCode(String postalCode)
GeoAddress object.postalCode - Specifies the postal code. The value can be null if unknown.public String getCountryCode()
GeoAddress object, for example, EN.GeoAddress object.
The value is null if no country code exists.public void setCountryCode(String countryCode)
GeoAddress object.countryCode - Specifies the country code. The value can be null if unknown.public String getCountryName()
GeoAddress object, for example, China.GeoAddress object.
The value is null if no country name exists.public void setCountryName(String countryName)
GeoAddress object.countryName - Specifies the country name. It can be null if unknown.public boolean hasLatitude()
GeoAddress object contains valid latitude information.true if the current GeoAddress object contains valid latitude
information; returns false otherwise.public double getLatitude()
GeoAddress object.GeoAddress object. The default value is 0.0.public void setLatitude(double latitude)
throws IllegalArgumentException
GeoAddress object.latitude - Specifies the latitude. The value range is [-90,90], in unit of degrees.IllegalArgumentException - Throws this exception if the latitude is not within the range [-90,90].public void clearLatitude()
GeoAddress object.public boolean hasLongitude()
GeoAddress object contains valid longitude information.true if the current GeoAddress object contains valid longitude
information; returns false otherwise.public double getLongitude()
GeoAddress object.GeoAddress object. The default value is 0.0.public void setLongitude(double longitude)
throws IllegalArgumentException
GeoAddress object.longitude - Specifies the longitude. The value range is [-180,180], in unit of degrees.IllegalArgumentException - Throws this exception if the longitude is not within the range [-180,180].public void clearLongitude()
GeoAddress object.public String getPhoneNumber()
GeoAddress object.GeoAddress object.
The value is null if no phone number exists.public void setPhoneNumber(String phone)
GeoAddress object.phone - Specifies the phone number. The value can be null if unknown.public String getAddressUrl()
GeoAddress object, for example,
the official website of a company.GeoAddress object.
The value is null if no website URL exists.public void setAddressUrl(String url)
GeoAddress object.url - Specifies the website URL. The value can be null if unknown.public String toString()
GeoAddress object into a character string.public boolean unmarshalling(Parcel in)
GeoAddress object and updates its data.
Unmarshalling of GeoAddress objects is implemented using Sequenceable.
unmarshalling 在接口中 Sequenceablein - Specifies the Parcel object for unmarshalling a GeoAddress object.
The value must not be null.true if unmarshaling is successful; returns false otherwise.Parcel,
Sequenceablepublic boolean marshalling(Parcel out)
GeoAddress object into a parcel.
Marshalling of GeoAddress objects is implemented using Sequenceable.
marshalling 在接口中 Sequenceableout - Specifies the Parcel object for marshalling a GeoAddress object.
The value must not be null.true if marshaling is successful; returns false otherwise.Parcel,
Sequenceable