+
+ /**
+ * Compare two search results for sorting (nearest first, then alphabetic)
+ */
+ public int compareTo(SearchResult inOther)
+ {
+ double distDiff = getLength() - inOther.getLength();
+ if (distDiff < 0.0)
+ {
+ return -1;
+ }
+ if (distDiff > 0.0)
+ {
+ return 1;
+ }
+ return getTrackName().compareTo(inOther.getTrackName());
+ }