net.agmodel.physical
Class Location
java.lang.Object
net.agmodel.physical.Location2D
net.agmodel.physical.Location
- All Implemented Interfaces:
- Comparable, Serializable
- Direct Known Subclasses:
- Place
- public class Location
- extends 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
The class is made final because it overrides the equals method.
If any classes extend this and add a field
then the equals method of this class is likely to not be transitive.
- See Also:
- Serialized Form
|
Constructor Summary |
Location(double latitude,
double longitude,
double altitude)
|
UNKNOWN
public static final Location UNKNOWN
Location
public Location(double latitude,
double longitude,
double altitude)
throws IllegalArgumentException
toString
public String toString()
- Overrides:
toString in class Location2D
getAltitude
public double getAltitude()
compareTo
public int compareTo(Object a)
- More northerly locations sort first.
If latitude is the same, more more westerly (lesser longitude) locations sort first.
If latitude and longitude are the same, boxes with higher altitude sort first.
- Specified by:
compareTo in interface Comparable- Overrides:
compareTo in class Location2D
equals
public boolean equals(Object o)
- Tests whether two objects represent the same Location.
- Overrides:
equals in class Location2D
- Parameters:
o - the other object
- Returns:
- true if the other object is a Location with the same latitude, longitude, and altitude
hashCode
public int hashCode()
- Overrides:
hashCode in class Location2D
Copyright (C) NARC 2001 All Rights Reserved.