Package org.mapsforge.poi.storage
Class WhitelistPoiCategoryFilter
- java.lang.Object
-
- org.mapsforge.poi.storage.WhitelistPoiCategoryFilter
-
- All Implemented Interfaces:
PoiCategoryFilter
public class WhitelistPoiCategoryFilter extends java.lang.Object implements PoiCategoryFilter
Whitelist category filter that accepts all categories and their sub-categories in the whitelist.
-
-
Constructor Summary
Constructors Constructor Description WhitelistPoiCategoryFilter()Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddCategory(PoiCategory category)Adds a POI category to the whitelist.java.util.Collection<PoiCategory>getAcceptedCategories()java.util.Collection<PoiCategory>getAcceptedSuperCategories()Returns a set of top-level categories for all accepted categories.booleanisAcceptedCategory(PoiCategory category)Returns true if a POI's category is accepted and therefore shall be added to the poi file.
-
-
-
Method Detail
-
addCategory
public void addCategory(PoiCategory category)
Adds a POI category to the whitelist. A parent category (e.g. amenity_food) automatically white lists its sub-categories. (Example: If amenity_food is in the whitelist and fast_food is a child category of amenity_food, then the filter will also accept POIs of category fast_food).- Specified by:
addCategoryin interfacePoiCategoryFilter- Parameters:
category- The category to be added to the whitelist.
-
getAcceptedCategories
public java.util.Collection<PoiCategory> getAcceptedCategories()
- Specified by:
getAcceptedCategoriesin interfacePoiCategoryFilter- Returns:
- All elements in the whitelist, including their children.
-
getAcceptedSuperCategories
public java.util.Collection<PoiCategory> getAcceptedSuperCategories()
Description copied from interface:PoiCategoryFilterReturns a set of top-level categories for all accepted categories. These are all accepted categories whose parent category is null or not an accepted category.- Specified by:
getAcceptedSuperCategoriesin interfacePoiCategoryFilter- Returns:
- Set of top-level categories for all accepted categories.
-
isAcceptedCategory
public boolean isAcceptedCategory(PoiCategory category)
Description copied from interface:PoiCategoryFilterReturns true if a POI's category is accepted and therefore shall be added to the poi file.- Specified by:
isAcceptedCategoryin interfacePoiCategoryFilter- Parameters:
category- The POI's category.- Returns:
- true if a POI's category is accepted and therefore shall be added to the poi file.
-
-