|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmccombe.mapping.LatLong
public class LatLong
A simple immutable wrapper class for Latitude and Longitude values
Constructor Summary | |
---|---|
LatLong()
Creates a new instance of LatLong |
|
LatLong(double lat,
double lon)
Create LatLong instance from specified values of Lat and Lon. |
Method Summary | |
---|---|
double |
lat()
Get the latitude component |
static double |
latDMS(java.lang.String ns,
int deg,
int min,
double sec)
A static method to turn values of degrees, minutes and seconds into a latitude value. |
double |
lon()
Get the longitude component |
static double |
lonDMS(java.lang.String ew,
int deg,
int min,
double sec)
A static method to turn values of degrees, minutes and seconds into a longitude value. |
static java.lang.String |
toDMS(double v,
java.lang.String signs)
|
java.lang.String |
toString()
Provide a String representing this latitude and longitude. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public LatLong()
public LatLong(double lat, double lon)
lat
- Latitude (degrees)lon
- Longitude (degrees)Method Detail |
---|
public static double latDMS(java.lang.String ns, int deg, int min, double sec) throws LatLongFormatException
ns
- "N" or "S". Points south of the equator have negative values of latitude.deg
- Degrees. Value must not exceed 90.min
- Minutes - zero or positive, less than 60.sec
- Seconds - zero or positive real value less than 60.0
LatLongFormatException
- if the degrees/minutes/seconds values do not correspond to legal latitudes between
0 and 90.0 or if ns is neither "N" nor "S"public static double lonDMS(java.lang.String ew, int deg, int min, double sec) throws LatLongFormatException
ew
- "E" or "W". Points west of the reference meridian have negative values of longitude.deg
- Degrees. Value must not exceed 180.min
- Minutes - zero or positive, less than 60.sec
- Seconds - zero or positive real value less than 60.0
LatLongFormatException
- if the degrees/minutes/seconds values do not correspond to legal longitudes between
0 and 180.0 or if ew is neither "E" nor "W"public double lat()
public double lon()
public java.lang.String toString()
toString
in class java.lang.Object
public static java.lang.String toDMS(double v, java.lang.String signs)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |