Class GeoComparator
java.lang.Object
org.deltava.comparators.GeoComparator
- All Implemented Interfaces:
Serializable, Comparator<GeoLocation>
A comparator to sort geographic locations by their distance from a fixed point.
- Since:
- 1.0
- Version:
- 8.6
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionGeoComparator(GeoLocation loc) Creates a new GeoComparator, comparing distance from an arbitrary location.GeoComparator(GeoLocation loc, boolean useFeet) Creates a new GeoComparator, comparing distance from an arbitrary location. -
Method Summary
Modifier and TypeMethodDescriptionintcompare(GeoLocation l1, GeoLocation l2) Returns the reference location.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
GeoComparator
Creates a new GeoComparator, comparing distance from an arbitrary location.- Parameters:
loc- the location
-
GeoComparator
Creates a new GeoComparator, comparing distance from an arbitrary location.- Parameters:
loc- the locationuseFeet- TRUE if the calculation should be measured in feet, otherwise FALSE for miles
-
-
Method Details
-
getLocation
-
compare
- Specified by:
comparein interfaceComparator<GeoLocation>
-