|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--net.agmodel.physical.Location2D
A location is simply a point on the planet. There may not be a weather station at this point. This abstraction is intended to support GIS type applications where data must be synthesised over a regular grid, irrespective of the location of individual stations. A 2D location does not hold any altitude information
| Field Summary | |
protected double |
latitude
|
protected double |
longitude
|
protected static NumberFormat |
nf
|
static Location2D |
UNKNOWN
|
| Constructor Summary | |
Location2D(double latitude,
double longitude)
Creates a Location2D object, ensuring latitude and longitude are within the standard ranges |
|
Location2D(double latitude,
double longitude,
boolean strict)
Creates a Location2D object, optionally clipping latitude to the range +/-90 and remapping longitude into the range +/-180 |
|
| Method Summary | |
int |
compareTo(Object a)
More northerly locations sort first. |
boolean |
equals(Object o)
Tests whether two objects represent the same 2D Location. |
double |
getLatitude()
|
double |
getLongitude()
|
int |
hashCode()
|
boolean |
isUnknown()
|
String |
toString()
|
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected static NumberFormat nf
public static final Location2D UNKNOWN
protected double latitude
protected double longitude
| Constructor Detail |
public Location2D(double latitude,
double longitude)
latitude - degrees from the equator + north, - south (from +90 to -90)longitude - degrees from Greenwich + east of Greenwich, - west of Greenwich (from +180 to -180)
public Location2D(double latitude,
double longitude,
boolean strict)
latitude - degrees from the equator + north, - southlongitude - degrees from Greenwich + east of Greenwich, - west of Greenwichstrict - if true, ensure that latitude is in range, otherwise clip and remap as above| Method Detail |
public String toString()
toString in class Objectpublic double getLongitude()
public double getLatitude()
public boolean isUnknown()
public int compareTo(Object a)
compareTo in interface Comparablepublic boolean equals(Object o)
equals in class Objecto - the other object
public int hashCode()
hashCode in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||