Back to project page PharmaApp.
The source code is released under:
MIT License
If you think the Android project PharmaApp listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package mobi.pharmaapp.util; // w ww. j a v a 2 s .c om import mobi.pharmaapp.models.UserModel; import java.util.Comparator; /** * * @author see /AUTHORS */ public class PharmacyComparator implements Comparator<Pharmacy> { public int compare(Pharmacy p1, Pharmacy p2) { float distP1 = p1.getLocation().distanceTo(UserModel.getInstance().getCurrentLocation()); float distP2 = p2.getLocation().distanceTo(UserModel.getInstance().getCurrentLocation()); return (int) (distP1 - distP2); } }