OsmAnd/OsmAnd-java/src/net/osmand/osm/PoiCategory.java

59 lines
1.1 KiB
Java
Raw Normal View History

2015-01-19 22:22:27 +01:00
package net.osmand.osm;
2015-01-20 23:32:35 +01:00
import java.util.ArrayList;
2015-04-06 23:24:25 +02:00
import java.util.LinkedHashSet;
2015-01-20 23:32:35 +01:00
import java.util.List;
2015-04-06 23:24:25 +02:00
import java.util.Map;
2015-01-20 23:32:35 +01:00
2015-02-18 23:21:57 +01:00
2015-01-20 23:32:35 +01:00
public class PoiCategory extends PoiFilter {
2015-02-18 23:21:57 +01:00
2015-01-20 23:32:35 +01:00
private List<PoiFilter> poiFilters = new ArrayList<PoiFilter>();
2015-02-18 23:21:57 +01:00
private int regId;
private String defaultTag;
public PoiCategory(MapPoiTypes registry, String keyName, int regId) {
2015-01-27 01:05:40 +01:00
super(registry, null, keyName);
2015-02-18 23:21:57 +01:00
this.regId = regId;
2015-01-19 22:22:27 +01:00
}
2015-02-18 23:21:57 +01:00
2015-01-20 23:32:35 +01:00
public void addPoiType(PoiFilter poi) {
poiFilters.add(poi);
2015-01-19 22:22:27 +01:00
}
2015-02-18 23:21:57 +01:00
2015-01-27 01:05:40 +01:00
public List<PoiFilter> getPoiFilters() {
return poiFilters;
}
2015-01-20 23:32:35 +01:00
2015-02-18 23:21:57 +01:00
public String getDefaultTag() {
if(defaultTag == null) {
return keyName;
}
return defaultTag;
}
public void setDefaultTag(String defaultTag) {
this.defaultTag = defaultTag;
}
2015-04-06 23:24:25 +02:00
public Map<PoiCategory, LinkedHashSet<String>> putTypes(
Map<PoiCategory, LinkedHashSet<String>> acceptedTypes) {
acceptedTypes.put(this, null);
addReferenceTypes(acceptedTypes);
return acceptedTypes;
}
2015-02-18 23:21:57 +01:00
public boolean isWiki() {
return keyName.equals(MapPoiTypes.OSM_WIKI_CATEGORY);
}
public int ordinal() {
return regId;
}
2015-04-05 13:51:01 +02:00
2015-01-19 22:22:27 +01:00
}