ac495120d9
git-svn-id: https://osmand.googlecode.com/svn/trunk@625 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
21 lines
No EOL
510 B
Java
21 lines
No EOL
510 B
Java
package net.osmand.data;
|
|
|
|
import java.text.Collator;
|
|
import java.util.Comparator;
|
|
|
|
public class MapObjectComparator implements Comparator<MapObject>{
|
|
private final boolean en;
|
|
Collator collator = Collator.getInstance();
|
|
public MapObjectComparator(boolean en){
|
|
this.en = en;
|
|
}
|
|
|
|
@Override
|
|
public int compare(MapObject o1, MapObject o2) {
|
|
if(en){
|
|
return collator.compare(o1.getEnName(), o2.getEnName());
|
|
} else {
|
|
return collator.compare(o1.getName(), o2.getName());
|
|
}
|
|
}
|
|
} |