X-Git-Url: http://git.linex4red.de/pub/Android/ownCloud.git/blobdiff_plain/54a4263eeba20fe9fe3d3afed5ef266c9bb88cb2..af2841eea2eb1240e6b6b95eab797d0cc24fcaa5:/src/third_parties/daveKoeller/AlphanumComparator.java diff --git a/src/third_parties/daveKoeller/AlphanumComparator.java b/src/third_parties/daveKoeller/AlphanumComparator.java index e86c3c47..03244930 100644 --- a/src/third_parties/daveKoeller/AlphanumComparator.java +++ b/src/third_parties/daveKoeller/AlphanumComparator.java @@ -24,6 +24,7 @@ package third_parties.daveKoeller; import java.text.Collator; +import java.io.File; import java.util.Comparator; import com.owncloud.android.datamodel.OCFile; @@ -77,9 +78,20 @@ public class AlphanumComparator implements Comparator } public int compare(OCFile o1, OCFile o2){ - String s1 = (String)o1.getRemotePath().toLowerCase(); - String s2 = (String)o2.getRemotePath().toLowerCase(); + String s1 = o1.getRemotePath().toLowerCase(); + String s2 = o2.getRemotePath().toLowerCase(); + return compare(s1, s2); + } + + public int compare(File f1, File f2){ + String s1 = f1.getPath().toLowerCase(); + String s2 = f2.getPath().toLowerCase(); + + return compare(s1, s2); + } + + public int compare(String s1, String s2) { int thisMarker = 0; int thatMarker = 0; int s1Length = s1.length(); @@ -111,7 +123,6 @@ public class AlphanumComparator implements Comparator Collator collator = Collator.getInstance(); collator.setStrength(Collator.PRIMARY); result = collator.compare(thisChunk, thatChunk); -// result = thisChunk.compareTo(thatChunk); } if (result != 0)