MapObject: add comparator

This commit is contained in:
Roman Inflianskas 2016-05-17 17:35:21 +03:00
parent 137854ee8c
commit 3802c811c7

View file

@ -23,6 +23,7 @@ public abstract class MapObject implements Comparable<MapObject> {
protected LatLon location = null; protected LatLon location = null;
protected int fileOffset = 0; protected int fileOffset = 0;
protected Long id = null; protected Long id = null;
public static final Comparator<MapObject> comparator = new MapObjectComparator();
public void setId(Long id) { public void setId(Long id) {
this.id = id; this.id = id;
@ -207,7 +208,12 @@ public abstract class MapObject implements Comparable<MapObject> {
public static class MapObjectComparator implements Comparator<MapObject> { public static class MapObjectComparator implements Comparator<MapObject> {
private final String l; private final String l;
Collator collator = OsmAndCollator.primaryCollator(); Collator collator = OsmAndCollator.primaryCollator();
public MapObjectComparator(String lang){
public MapObjectComparator() {
this.l = null;
}
public MapObjectComparator(String lang) {
this.l = lang; this.l = lang;
} }