Address
open class Address : Parcelable
kotlin.Any | |
↳ | android.location.Address |
A class representing an Address, that is, a set of Strings describing a location. The address format is a simplified version of xAL (eXtensible Address Language) http://www.oasis-open.org/committees/ciq/ciq.html#6
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
Constructs a new Address object set to the given Locale and with all other fields initialized to null or false. |
Public methods | |
---|---|
open Unit |
Removes any latitude associated with this address. |
open Unit |
Removes any longitude associated with this address. |
open Int | |
open String! |
getAddressLine(index: Int) Returns a line of the address numbered by the given index (starting at 0), or null if no such line is present. |
open String! |
Returns the administrative area name of the address, for example, "CA", or null if it is unknown |
open String! |
Returns the country code of the address, for example "US", or null if it is unknown. |
open String! |
Returns the localized country name of the address, for example "Iceland", or null if it is unknown. |
open Bundle! |
Returns additional provider-specific information about the address as a Bundle. |
open String! |
Returns the feature name of the address, for example, "Golden Gate Bridge", or null if it is unknown |
open Double |
Returns the latitude of the address if known. |
open Locale! |
Returns the Locale associated with this address. |
open String! |
Returns the locality of the address, for example "Mountain View", or null if it is unknown. |
open Double |
Returns the longitude of the address if known. |
open Int |
Returns the largest index currently in use to specify an address line. |
open String! |
getPhone() Returns the phone number of the address if known, or null if it is unknown. |
open String! |
Returns the postal code of the address, for example "94110", or null if it is unknown. |
open String! |
Returns the premises of the address, or null if it is unknown. |
open String! |
Returns the sub-administrative area name of the address, for example, "Santa Clara County", or null if it is unknown |
open String! |
Returns the sub-locality of the address, or null if it is unknown. |
open String! |
Returns the sub-thoroughfare name of the address, which may be null. |
open String! |
Returns the thoroughfare name of the address, for example, "1600 Ampitheater Parkway", which may be null |
open String! |
getUrl() Returns the public URL for the address if known, or null if it is unknown. |
open Boolean |
Returns true if a latitude has been assigned to this Address, false otherwise. |
open Boolean |
Returns true if a longitude has been assigned to this Address, false otherwise. |
open Unit |
setAddressLine(index: Int, line: String!) Sets the line of the address numbered by index (starting at 0) to the given String, which may be null. |
open Unit |
setAdminArea(adminArea: String!) Sets the administrative area name of the address to the given String, which may be null |
open Unit |
setCountryCode(countryCode: String!) Sets the country code of the address to the given String, which may be null. |
open Unit |
setCountryName(countryName: String!) Sets the country name of the address to the given String, which may be null. |
open Unit |
Sets the extra information associated with this fix to the given Bundle. |
open Unit |
setFeatureName(featureName: String!) Sets the feature name of the address to the given String, which may be null |
open Unit |
setLatitude(latitude: Double) Sets the latitude associated with this address. |
open Unit |
setLocality(locality: String!) Sets the locality of the address to the given String, which may be null. |
open Unit |
setLongitude(longitude: Double) Sets the longitude associated with this address. |
open Unit |
Sets the phone number associated with this address. |
open Unit |
setPostalCode(postalCode: String!) Sets the postal code of the address to the given String, which may be null. |
open Unit |
setPremises(premises: String!) Sets the premises of the address to the given String, which may be null. |
open Unit |
setSubAdminArea(subAdminArea: String!) Sets the sub-administrative area name of the address to the given String, which may be null |
open Unit |
setSubLocality(sublocality: String!) Sets the sub-locality of the address to the given String, which may be null. |
open Unit |
setSubThoroughfare(subthoroughfare: String!) Sets the sub-thoroughfare name of the address, which may be null. |
open Unit |
setThoroughfare(thoroughfare: String!) Sets the thoroughfare name of the address, which may be null. |
open Unit |
Sets the public URL associated with this address. |
open String |
toString() |
open Unit |
writeToParcel(parcel: Parcel, flags: Int) |
Properties | |
---|---|
static Parcelable.Creator<Address!> |
Public constructors
Address
Address(locale: Locale!)
Constructs a new Address object set to the given Locale and with all other fields initialized to null or false.
Public methods
clearLatitude
open fun clearLatitude(): Unit
Removes any latitude associated with this address.
clearLongitude
open fun clearLongitude(): Unit
Removes any longitude associated with this address.
describeContents
open fun describeContents(): Int
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
getAddressLine
open fun getAddressLine(index: Int): String!
Returns a line of the address numbered by the given index (starting at 0), or null if no such line is present.
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if index < 0 |
getAdminArea
open fun getAdminArea(): String!
Returns the administrative area name of the address, for example, "CA", or null if it is unknown
getCountryCode
open fun getCountryCode(): String!
Returns the country code of the address, for example "US", or null if it is unknown.
getCountryName
open fun getCountryName(): String!
Returns the localized country name of the address, for example "Iceland", or null if it is unknown.
getExtras
open fun getExtras(): Bundle!
Returns additional provider-specific information about the address as a Bundle. The keys and values are determined by the provider. If no additional information is available, null is returned.
getFeatureName
open fun getFeatureName(): String!
Returns the feature name of the address, for example, "Golden Gate Bridge", or null if it is unknown
getLatitude
open fun getLatitude(): Double
Returns the latitude of the address if known.
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this Address has not been assigned a latitude. |
getLocale
open fun getLocale(): Locale!
Returns the Locale associated with this address.
getLocality
open fun getLocality(): String!
Returns the locality of the address, for example "Mountain View", or null if it is unknown.
getLongitude
open fun getLongitude(): Double
Returns the longitude of the address if known.
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this Address has not been assigned a longitude. |
getMaxAddressLineIndex
open fun getMaxAddressLineIndex(): Int
Returns the largest index currently in use to specify an address line. If no address lines are specified, -1 is returned.
getPhone
open fun getPhone(): String!
Returns the phone number of the address if known, or null if it is unknown.
Exceptions | |
---|---|
java.lang.IllegalStateException |
if this Address has not been assigned a phone number. |
getPostalCode
open fun getPostalCode(): String!
Returns the postal code of the address, for example "94110", or null if it is unknown.
getPremises
open fun getPremises(): String!
Returns the premises of the address, or null if it is unknown.
getSubAdminArea
open fun getSubAdminArea(): String!
Returns the sub-administrative area name of the address, for example, "Santa Clara County", or null if it is unknown
getSubLocality
open fun getSubLocality(): String!
Returns the sub-locality of the address, or null if it is unknown. For example, this may correspond to the neighborhood of the locality.
getSubThoroughfare
open fun getSubThoroughfare(): String!
Returns the sub-thoroughfare name of the address, which may be null. This may correspond to the street number of the address.
getThoroughfare
open fun getThoroughfare(): String!
Returns the thoroughfare name of the address, for example, "1600 Ampitheater Parkway", which may be null
getUrl
open fun getUrl(): String!
Returns the public URL for the address if known, or null if it is unknown.
hasLatitude
open fun hasLatitude(): Boolean
Returns true if a latitude has been assigned to this Address, false otherwise.
hasLongitude
open fun hasLongitude(): Boolean
Returns true if a longitude has been assigned to this Address, false otherwise.
setAddressLine
open fun setAddressLine(
index: Int,
line: String!
): Unit
Sets the line of the address numbered by index (starting at 0) to the given String, which may be null.
Exceptions | |
---|---|
java.lang.IllegalArgumentException |
if index < 0 |
setAdminArea
open fun setAdminArea(adminArea: String!): Unit
Sets the administrative area name of the address to the given String, which may be null
setCountryCode
open fun setCountryCode(countryCode: String!): Unit
Sets the country code of the address to the given String, which may be null.
setCountryName
open fun setCountryName(countryName: String!): Unit
Sets the country name of the address to the given String, which may be null.
setExtras
open fun setExtras(extras: Bundle!): Unit
Sets the extra information associated with this fix to the given Bundle.
setFeatureName
open fun setFeatureName(featureName: String!): Unit
Sets the feature name of the address to the given String, which may be null
setLatitude
open fun setLatitude(latitude: Double): Unit
Sets the latitude associated with this address.
setLocality
open fun setLocality(locality: String!): Unit
Sets the locality of the address to the given String, which may be null.
setLongitude
open fun setLongitude(longitude: Double): Unit
Sets the longitude associated with this address.
setPhone
open fun setPhone(phone: String!): Unit
Sets the phone number associated with this address.
setPostalCode
open fun setPostalCode(postalCode: String!): Unit
Sets the postal code of the address to the given String, which may be null.
setPremises
open fun setPremises(premises: String!): Unit
Sets the premises of the address to the given String, which may be null.
setSubAdminArea
open fun setSubAdminArea(subAdminArea: String!): Unit
Sets the sub-administrative area name of the address to the given String, which may be null
setSubLocality
open fun setSubLocality(sublocality: String!): Unit
Sets the sub-locality of the address to the given String, which may be null.
setSubThoroughfare
open fun setSubThoroughfare(subthoroughfare: String!): Unit
Sets the sub-thoroughfare name of the address, which may be null.
setThoroughfare
open fun setThoroughfare(thoroughfare: String!): Unit
Sets the thoroughfare name of the address, which may be null.
setUrl
open fun setUrl(Url: String!): Unit
Sets the public URL associated with this address.
toString
open fun toString(): String
Return | |
---|---|
String |
a string representation of the object. |
writeToParcel
open fun writeToParcel(
parcel: Parcel,
flags: Int
): Unit
Parameters | |
---|---|
dest |
The Parcel in which the object should be written. This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |