package cgeo.geocaching.sorting;

import cgeo.geocaching.Geocache;

import org.apache.commons.lang3.StringUtils;

/**
 * sorts caches by name
 *
 */
class NameComparator extends AbstractCacheComparator {

    @Override
    protected boolean canCompare(final Geocache cache) {
        return StringUtils.isNotBlank(cache.getName());
    }

    @Override
    protected int compareCaches(final Geocache cache1, final Geocache cache2) {
        return cache1.getNameForSorting().compareToIgnoreCase(cache2.getNameForSorting());
    }
}

@@ -59,16 +59,56 @@
 eocache;
+%0Aimport cgeo.geocaching.utils.TextUtils;
 %0A%0Aimport
@@ -147,16 +147,44 @@
 Utils;%0A%0A
+import java.text.Collator;%0A%0A
 /**%0A * s
@@ -266,16 +266,135 @@
 ator %7B%0A%0A
+    private final Collator collator;%0A%0A    public NameComparator() %7B%0A        collator = TextUtils.getCollator();%0A    %7D%0A%0A
     @Ove
@@ -628,16 +628,33 @@
  return 
+collator.compare(
 cache1.g
@@ -675,29 +675,10 @@
 ng()
-.compareToIgnoreCase(
+, 
 cach

use improved comparator also for cache names