Fields Summary |
---|
public static final int | COUNTRY_SOURCE_NETWORKThe country code came from the mobile network |
public static final int | COUNTRY_SOURCE_LOCATIONThe country code came from the location service |
public static final int | COUNTRY_SOURCE_SIMThe country code was read from the SIM card |
public static final int | COUNTRY_SOURCE_LOCALEThe country code came from the system locale setting |
private final String | mCountryIsoThe ISO 3166-1 two letters country code. |
private final int | mSourceWhere the country code came from. |
private int | mHashCode |
private final long | mTimestampTime that this object was created (which we assume to be the time that the source was
consulted). This time is in milliseconds since boot up. |
public static final Parcelable.Creator | CREATOR |
Methods Summary |
---|
public int | describeContents()
return 0;
|
public boolean | equals(java.lang.Object object)Returns true if this {@link Country} is equivalent to the given object. This ignores
the timestamp value and just checks for equivalence of countryIso and source values.
Returns false otherwise.
if (object == this) {
return true;
}
if (object instanceof Country) {
Country c = (Country) object;
// No need to check the equivalence of the timestamp
return mCountryIso.equals(c.getCountryIso()) && mSource == c.getSource();
}
return false;
|
public boolean | equalsIgnoreSource(android.location.Country country)Compare the specified country to this country object ignoring the source
and timestamp fields, return true if the countryIso fields are equal
return country != null && mCountryIso.equals(country.getCountryIso());
|
public final java.lang.String | getCountryIso()
return mCountryIso;
|
public final int | getSource()
return mSource;
|
public final long | getTimestamp()Returns the time that this object was created (which we assume to be the time that the source
was consulted).
return mTimestamp;
|
public int | hashCode()
int hash = mHashCode;
if (hash == 0) {
hash = 17;
hash = hash * 13 + mCountryIso.hashCode();
hash = hash * 13 + mSource;
mHashCode = hash;
}
return mHashCode;
|
public java.lang.String | toString()
return "Country {ISO=" + mCountryIso + ", source=" + mSource + ", time=" + mTimestamp + "}";
|
public void | writeToParcel(android.os.Parcel parcel, int flags)
parcel.writeString(mCountryIso);
parcel.writeInt(mSource);
parcel.writeLong(mTimestamp);
|