public class GeoLocation extends IntegerGeoPoint implements java.lang.Comparable<GeoLocation>, java.util.Comparator<GeoLocation>
Modifier and Type | Field and Description |
---|---|
private byte[] |
name |
private int |
population |
Constructor and Description |
---|
GeoLocation(double lat,
double lon) |
GeoLocation(double lat,
double lon,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
int |
compare(GeoLocation o1,
GeoLocation o2) |
int |
compareTo(GeoLocation o)
comparator that is needed to use the object inside TreeMap/TreeSet
a Location is smaller than another if it has a _greater_ population
this order is used to get sorted lists of locations where the first elements
have the greatest population
|
static int |
degreeToKm(double degree) |
boolean |
equals(java.lang.Object loc)
equality test that is needed to use the class inside HashMap/HashSet
|
java.lang.String |
getName() |
int |
getPopulation() |
private static long |
ph(int population) |
void |
setName(java.lang.String name) |
void |
setPopulation(int population) |
accuracyLat, accuracyLon, hashCode, lat, lon, main, toString
public GeoLocation(double lat, double lon)
public GeoLocation(double lat, double lon, java.lang.String name)
public void setName(java.lang.String name)
public java.lang.String getName()
public void setPopulation(int population)
public int getPopulation()
public boolean equals(java.lang.Object loc)
IntegerGeoPoint
equals
in interface java.util.Comparator<GeoLocation>
equals
in interface GeoPoint
equals
in class IntegerGeoPoint
public int compareTo(GeoLocation o)
compareTo
in interface java.lang.Comparable<GeoLocation>
private static long ph(int population)
public int compare(GeoLocation o1, GeoLocation o2)
compare
in interface java.util.Comparator<GeoLocation>
public static int degreeToKm(double degree)