OsmAnd/DataExtractionOSM/src/net/osmand/data/MapObjectComparator.java
Victor Shcherb ac495120d9 add new address index format support
git-svn-id: https://osmand.googlecode.com/svn/trunk@625 e29c36b1-1cfa-d876-8d93-3434fc2bb7b8
2010-11-02 21:59:47 +00:00

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());
}
}
}