Methods Summary |
---|
public void | clearLatitude()Removes any latitude associated with this address.
mHasLatitude = false;
|
public void | clearLongitude()Removes any longitude associated with this address.
mHasLongitude = false;
|
public int | describeContents()
return (mExtras != null) ? mExtras.describeContents() : 0;
|
public java.lang.String | getAddressLine(int index)Returns a line of the address numbered by the given index
(starting at 0), or null if no such line is present.
if (index < 0) {
throw new IllegalArgumentException("index = " + index + " < 0");
}
return mAddressLines == null? null : mAddressLines.get(index);
|
public java.lang.String | getAdminArea()Returns the administrative area name of the address, for example, "CA", or null if
it is unknown
return mAdminArea;
|
public java.lang.String | getCountryCode()Returns the country code of the address, for example "US",
or null if it is unknown.
return mCountryCode;
|
public java.lang.String | getCountryName()Returns the localized country name of the address, for example "Iceland",
or null if it is unknown.
return mCountryName;
|
public android.os.Bundle | getExtras()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.
return mExtras;
|
public java.lang.String | getFeatureName()Returns the feature name of the address, for example, "Golden Gate Bridge", or null
if it is unknown
return mFeatureName;
|
public double | getLatitude()Returns the latitude of the address if known.
if (mHasLatitude) {
return mLatitude;
} else {
throw new IllegalStateException();
}
|
public java.util.Locale | getLocale()Returns the Locale associated with this address.
return mLocale;
|
public java.lang.String | getLocality()Returns the locality of the address, for example "Mountain View", or null if it is unknown.
return mLocality;
|
public double | getLongitude()Returns the longitude of the address if known.
if (mHasLongitude) {
return mLongitude;
} else {
throw new IllegalStateException();
}
|
public int | getMaxAddressLineIndex()Returns the largest index currently in use to specify an address line.
If no address lines are specified, -1 is returned.
return mMaxAddressLineIndex;
|
public java.lang.String | getPhone()Returns the phone number of the address if known,
or null if it is unknown.
return mPhone;
|
public java.lang.String | getPostalCode()Returns the postal code of the address, for example "94110",
or null if it is unknown.
return mPostalCode;
|
public java.lang.String | getSubAdminArea()Returns the sub-administrative area name of the address, for example, "Santa Clara County",
or null if it is unknown
return mSubAdminArea;
|
public java.lang.String | getThoroughfare()Returns the thoroughfare name of the address, for example, "1600 Ampitheater Parkway",
which may be null
return mThoroughfare;
|
public java.lang.String | getUrl()Returns the public URL for the address if known,
or null if it is unknown.
return mUrl;
|
public boolean | hasLatitude()Returns true if a latitude has been assigned to this Address,
false otherwise.
return mHasLatitude;
|
public boolean | hasLongitude()Returns true if a longitude has been assigned to this Address,
false otherwise.
return mHasLongitude;
|
public void | setAddressLine(int index, java.lang.String line)Sets the line of the address numbered by index (starting at 0) to the
given String, which may be null.
if (index < 0) {
throw new IllegalArgumentException("index = " + index + " < 0");
}
if (mAddressLines == null) {
mAddressLines = new HashMap<Integer, String>();
}
mAddressLines.put(index, line);
if (line == null) {
// We've eliminated a line, recompute the max index
mMaxAddressLineIndex = -1;
for (Integer i : mAddressLines.keySet()) {
mMaxAddressLineIndex = Math.max(mMaxAddressLineIndex, i);
}
} else {
mMaxAddressLineIndex = Math.max(mMaxAddressLineIndex, index);
}
|
public void | setAdminArea(java.lang.String adminArea)Sets the administrative area name of the address to the given String, which may be null
this.mAdminArea = adminArea;
|
public void | setCountryCode(java.lang.String countryCode)Sets the country code of the address to the given String, which may
be null.
mCountryCode = countryCode;
|
public void | setCountryName(java.lang.String countryName)Sets the country name of the address to the given String, which may
be null.
mCountryName = countryName;
|
public void | setExtras(android.os.Bundle extras)Sets the extra information associated with this fix to the
given Bundle.
mExtras = (extras == null) ? null : new Bundle(extras);
|
public void | setFeatureName(java.lang.String featureName)Sets the feature name of the address to the given String, which may be null
mFeatureName = featureName;
|
public void | setLatitude(double latitude)Sets the latitude associated with this address.
mLatitude = latitude;
mHasLatitude = true;
|
public void | setLocality(java.lang.String locality)Sets the locality of the address to the given String, which may be null.
mLocality = locality;
|
public void | setLongitude(double longitude)Sets the longitude associated with this address.
mLongitude = longitude;
mHasLongitude = true;
|
public void | setPhone(java.lang.String phone)Sets the phone number associated with this address.
mPhone = phone;
|
public void | setPostalCode(java.lang.String postalCode)Sets the postal code of the address to the given String, which may
be null.
mPostalCode = postalCode;
|
public void | setSubAdminArea(java.lang.String subAdminArea)Sets the sub-administrative area name of the address to the given String, which may be null
this.mSubAdminArea = subAdminArea;
|
public void | setThoroughfare(java.lang.String thoroughfare)Sets the thoroughfare name of the address, which may be null.
this.mThoroughfare = thoroughfare;
|
public void | setUrl(java.lang.String Url)Sets the public URL associated with this address.
mUrl = Url;
|
public java.lang.String | toString()
StringBuilder sb = new StringBuilder();
sb.append("Address[addressLines=[");
for (int i = 0; i <= mMaxAddressLineIndex; i++) {
if (i > 0) {
sb.append(',");
}
sb.append(i);
sb.append(':");
String line = mAddressLines.get(i);
if (line == null) {
sb.append("null");
} else {
sb.append('\"");
sb.append(line);
sb.append('\"");
}
}
sb.append(']");
sb.append(",feature=");
sb.append(mFeatureName);
sb.append(",admin=");
sb.append(mAdminArea);
sb.append(",sub-admin=");
sb.append(mSubAdminArea);
sb.append(",locality=");
sb.append(mLocality);
sb.append(",thoroughfare=");
sb.append(mThoroughfare);
sb.append(",postalCode=");
sb.append(mPostalCode);
sb.append(",countryCode=");
sb.append(mCountryCode);
sb.append(",countryName=");
sb.append(mCountryName);
sb.append(",hasLatitude=");
sb.append(mHasLatitude);
sb.append(",latitude=");
sb.append(mLatitude);
sb.append(",hasLongitude=");
sb.append(mHasLongitude);
sb.append(",longitude=");
sb.append(mLongitude);
sb.append(",phone=");
sb.append(mPhone);
sb.append(",url=");
sb.append(mUrl);
sb.append(",extras=");
sb.append(mExtras);
sb.append(']");
return sb.toString();
|
public void | writeToParcel(android.os.Parcel parcel, int flags)
parcel.writeString(mLocale.getLanguage());
parcel.writeString(mLocale.getCountry());
if (mAddressLines == null) {
parcel.writeInt(0);
} else {
Set<Map.Entry<Integer, String>> entries = mAddressLines.entrySet();
parcel.writeInt(entries.size());
for (Map.Entry<Integer, String> e : entries) {
parcel.writeInt(e.getKey());
parcel.writeString(e.getValue());
}
}
parcel.writeString(mFeatureName);
parcel.writeString(mAdminArea);
parcel.writeString(mSubAdminArea);
parcel.writeString(mLocality);
parcel.writeString(mThoroughfare);
parcel.writeString(mPostalCode);
parcel.writeString(mCountryCode);
parcel.writeString(mCountryName);
parcel.writeInt(mHasLatitude ? 1 : 0);
if (mHasLatitude) {
parcel.writeDouble(mLatitude);
}
parcel.writeInt(mHasLongitude ? 1 : 0);
if (mHasLongitude){
parcel.writeDouble(mLongitude);
}
parcel.writeString(mPhone);
parcel.writeString(mUrl);
parcel.writeBundle(mExtras);
|