Refactoring: reuse ACCEPT_ALL_POI_TYPE_FILTER

This commit is contained in:
Roman Inflianskas 2016-06-15 10:41:55 +03:00
parent b8e491d596
commit 8b5ccf1e30
2 changed files with 2 additions and 24 deletions

View file

@ -1070,18 +1070,7 @@ public class BinaryInspector {
MapUtils.get31TileNumberY(verbose.lattop), MapUtils.get31TileNumberY(verbose.lattop),
MapUtils.get31TileNumberY(verbose.latbottom), MapUtils.get31TileNumberY(verbose.latbottom),
verbose.getZoom(), verbose.getZoom(),
new SearchPoiTypeFilter() { BinaryMapIndexReader.ACCEPT_ALL_POI_TYPE_FILTER,
@Override
public boolean accept(PoiCategory type, String subcategory) {
return true;
}
@Override
public boolean isEmpty() {
return false;
}
},
new ResultMatcher<Amenity>() { new ResultMatcher<Amenity>() {
@Override @Override
public boolean publish(Amenity object) { public boolean publish(Amenity object) {

View file

@ -2180,18 +2180,7 @@ public class BinaryMapIndexReader {
println(" " + poiRegion.subcategories.get(i)); println(" " + poiRegion.subcategories.get(i));
} }
SearchRequest<Amenity> req = buildSearchPoiRequest(sleft, sright, stop, sbottom, -1, new SearchPoiTypeFilter() { SearchRequest<Amenity> req = buildSearchPoiRequest(sleft, sright, stop, sbottom, -1, ACCEPT_ALL_POI_TYPE_FILTER, null);
@Override
public boolean accept(PoiCategory type, String subcategory) {
return true;
}
@Override
public boolean isEmpty() {
return false;
}
}, null);
List<Amenity> results = reader.searchPoi(req); List<Amenity> results = reader.searchPoi(req);
for (Amenity a : results) { for (Amenity a : results) {
println(a.getType() + " " + a.getSubType() + " " + a.getName() + " " + a.getLocation()); println(a.getType() + " " + a.getSubType() + " " + a.getName() + " " + a.getLocation());