public final class GeoPoint extends Object implements Parcelable
Parcelable.ClassLoaderCreator<T>, Parcelable.Creator<T>| Modifier and Type | Field and Description |
|---|---|
static Parcelable.Creator<GeoPoint> |
CREATOR
Parcelable creator for this type.
|
static double |
MAX_LATITUDE
Maximum valid latitude coordinate.
|
static double |
MAX_LONGITUDE
Maximum valid longitude coordinate.
|
static double |
MIN_LATITUDE
Minimum valid latitude coordinate.
|
static double |
MIN_LONGITUDE
Minimum valid longitude coordinate.
|
static GeoPoint |
NAN
Represents an invalid
GeoPoint. |
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE| Constructor and Description |
|---|
GeoPoint(double latitude,
double longitude)
Initializes a new instance of the
GeoPoint. |
| Modifier and Type | Method and Description |
|---|---|
int |
describeContents() |
boolean |
equals(Object o) |
static GeoPoint |
fromLocation(Location value)
|
double |
getLatitude()
Gets the latitude value.
|
double |
getLongitude()
Gets the longitude value.
|
int |
hashCode() |
boolean |
isValid()
Checks if current instance is valid.
|
static boolean |
isValid(GeoPoint point)
Checks if a
GeoPoint is valid. |
static GeoPoint |
parse(String value)
Parses
GeoPoint from the specified string. |
static GeoPoint |
parse(String value,
String separator)
Parses
GeoPoint from a specified string. |
Location |
toLocation(String source)
|
String |
toString() |
void |
writeToParcel(Parcel dest,
int flags) |
public static final Parcelable.Creator<GeoPoint> CREATOR
public static final double MIN_LATITUDE
public static final double MAX_LATITUDE
public static final double MIN_LONGITUDE
public static final double MAX_LONGITUDE
public static final GeoPoint NAN
GeoPoint.public GeoPoint(double latitude,
double longitude)
GeoPoint.
Latitude should be within [-90;90] and longitude should be within
[-180;180].latitude - The latitude.longitude - The longitude.public static boolean isValid(GeoPoint point)
GeoPoint is valid.point - The point to check.true, if the point is valid; otherwise, false.public boolean isValid()
true if it is a valid GeoPoint, false otherwisepublic double getLatitude()
public double getLongitude()
public Location toLocation(String source)
source - Location source (provider name).Location.public static GeoPoint parse(String value)
GeoPoint from the specified string.value - The string to parse.GeoPoint.public static GeoPoint parse(String value, String separator)
GeoPoint from a specified string.value - Target string value.separator - Values separator.GeoPoint.public int describeContents()
describeContents in interface Parcelablepublic void writeToParcel(Parcel dest, int flags)
writeToParcel in interface ParcelableCopyright © 2013-2016 INRIX, Inc. All Rights Reserved.