public final class GPSInfo
extends java.lang.Object
Constructor and Description |
---|
GPSInfo(java.math.BigDecimal latitude,
java.math.BigDecimal longitude,
java.math.BigDecimal altitude)
Constructs the new GPS information with current date time.
|
GPSInfo(java.math.BigDecimal latitude,
java.math.BigDecimal longitude,
java.math.BigDecimal altitude,
java.util.Date dateTime)
Constructs the new GPS information with specified date time.
|
GPSInfo(java.math.BigDecimal latitude,
java.math.BigDecimal longitude,
java.math.BigDecimal altitude,
java.util.Date dateTime,
int offset)
Constructs the new GPS information with specified date time and timezone offset.
|
Modifier and Type | Method and Description |
---|---|
boolean |
almostEquals(java.lang.Object o) |
boolean |
equals(java.lang.Object o) |
java.math.BigDecimal |
getAltitude()
Returns the altitude of this GPS information.
|
java.util.Date |
getDateTime()
Returns the date time of this GPS information.
|
java.math.BigDecimal |
getLatitude()
Returns the latitude of this GPS information.
|
java.math.BigDecimal |
getLongitude()
Returns the longitude of this GPS information.
|
int |
getOffset()
Returns the number of milliseconds of the timezone of this GPS information.
|
long |
getTime()
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT of this GPS information.
|
int |
hashCode() |
static GPSInfo |
parse(java.lang.String str)
Returns the GPS information from the string represented in the following format.
|
java.lang.String |
toString()
Returns the string representation of the GPS information.
|
public GPSInfo(java.math.BigDecimal latitude, java.math.BigDecimal longitude, java.math.BigDecimal altitude)
latitude
- latitude value for GPS information. (-90.000000 <= latitude <= 90.000000)longitude
- longitude value for GPS information. (-180.000000 <= longitude <= 180.000000)altitude
- altitude value for GPS information. (0.00 <= altitude <= 999.99)public GPSInfo(java.math.BigDecimal latitude, java.math.BigDecimal longitude, java.math.BigDecimal altitude, java.util.Date dateTime)
latitude
- latitude value for GPS information. (-90.000000 <= latitude <= 90.000000)longitude
- longitude value for GPS information. (-180.000000 <= longitude <= 180.000000)altitude
- altitude value for GPS information. (0.00 <= altitude <= 999.99)dateTime
- date time value for GPS information.public GPSInfo(java.math.BigDecimal latitude, java.math.BigDecimal longitude, java.math.BigDecimal altitude, java.util.Date dateTime, int offset)
latitude
- latitude value for GPS information. (-90.000000 <= latitude <= 90.000000)longitude
- longitude value for GPS information. (-180.000000 <= longitude <= 180.000000)altitude
- altitude value for GPS information. (0.00 <= altitude <= 999.99)dateTime
- date time value for GPS information.offset
- timezone offset in milliseconds.public static GPSInfo parse(java.lang.String str) throws java.text.ParseException
Returns the GPS information from the string represented in the following format.
Format: <latitude>,<longitude><altitude>m@<date-time><timezone>,<datum>
Example: -90.000000,-180.000000-999.00m@20150921T235959+0900,WGS84
java.text.ParseException
- The given string does not match with the defined format.public java.math.BigDecimal getLatitude()
public java.math.BigDecimal getLongitude()
public java.math.BigDecimal getAltitude()
public java.util.Date getDateTime()
public int getOffset()
public long getTime()
public java.lang.String toString()
Returns the string representation of the GPS information.
Format: <latitude>,<longitude><altitude>m@<date-time><timezone>,<datum>
Example: -90.000000,-180.000000-999.00m@20150921T235959+0900,WGS84
toString
in class java.lang.Object
public boolean almostEquals(java.lang.Object o)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object