|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object uk.me.jstott.coordconv.LatitudeLongitude
public class LatitudeLongitude
An object to represent a latitude and longitude pair. Latitudes and longitudes are used to represent a point on a spherical surface, for example, a point on the surface of Earth. Latitudes and longitudes are measured in degrees, minutes and seconds. For more information on using this class, look at http://www.jstott.me.uk/jsuntimes/
Field Summary | |
---|---|
static int |
EAST
|
static int |
NORTH
|
static int |
SOUTH
|
static int |
WEST
|
Constructor Summary | |
---|---|
LatitudeLongitude(double lat,
double lng)
Construct a latitude and longitude pair. |
|
LatitudeLongitude(int degreesLat,
int minutesLat,
double secondsLat,
int degreesLong,
int minutesLong,
double secondsLong)
Construct a latitude and longitude pair. |
|
LatitudeLongitude(int northSouth,
int degreesLat,
int minutesLat,
double secondsLat,
int eastWest,
int degreesLong,
int minutesLong,
double secondsLong)
Construct a latitude and longitude pair. |
Method Summary | |
---|---|
double |
getLatitude()
Get the latitude |
double |
getLongitude()
Get the longitude |
void |
setLatitude(double latitude)
Set the latitude |
void |
setLongitude(double longitude)
Set the longitude |
java.lang.String |
toString()
Get a string representation of the latitude and longitude in the form 52°39'27.2531"N 1°43'4.5177"E |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NORTH
public static final int SOUTH
public static final int EAST
public static final int WEST
Constructor Detail |
---|
public LatitudeLongitude(double lat, double lng)
lat
- the latitudelng
- the longitudepublic LatitudeLongitude(int northSouth, int degreesLat, int minutesLat, double secondsLat, int eastWest, int degreesLong, int minutesLong, double secondsLong)
northSouth
- one of LatitudeLongitude.NORTH and LatitudeLongitude.SOUTH to
represent whether the given latitude is north or south of the
equator respectivelydegreesLat
- degrees of latitudeminutesLat
- minutes of latitudesecondsLat
- seconds of latitudeeastWest
- one of LatitudeLongitude.East and LatitudeLongitude.WEST to
represent whether the given longitude is east or west of the
Greenwich Meridian respectivelydegreesLong
- degrees of longitudeminutesLong
- minutes of longitudesecondsLong
- seconds of longitudepublic LatitudeLongitude(int degreesLat, int minutesLat, double secondsLat, int degreesLong, int minutesLong, double secondsLong)
degreesLat
- degrees of latitudeminutesLat
- minutes of latitudesecondsLat
- seconds of latitudedegreesLong
- degrees of longitudeminutesLong
- minutes of longitudesecondsLong
- seconds of longitudeMethod Detail |
---|
public double getLatitude()
public double getLongitude()
public void setLatitude(double latitude)
latitude
- the new value of the latitudepublic void setLongitude(double longitude)
longitude
- the new value of the longitudepublic java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |