Package org.mapsforge.poi.storage
Class AbstractPoiCategoryManager
java.lang.Object
org.mapsforge.poi.storage.AbstractPoiCategoryManager
- All Implemented Interfaces:
PoiCategoryManager
Abstract implementation for the
PoiCategoryManager interface. This implementation
provides functionality for getting categories by their ID / name.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Map<Integer,PoiCategory> Maps category IDs to categories.protected PoiCategoryThe hierarchies root category.protected static final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPoiCategoryByID(int id) Returns a category given by its ID or throws an exception if this category does not exist.getPoiCategoryByTitle(String title) Returns a category given by unique title or throws an exception if this category does not exist.Returns the category tree's root.
-
Field Details
-
SELECT_STATEMENT
- See Also:
-
rootCategory
The hierarchies root category. -
categoryMap
Maps category IDs to categories.
-
-
Constructor Details
-
AbstractPoiCategoryManager
public AbstractPoiCategoryManager()
-
-
Method Details
-
getPoiCategoryByID
Returns a category given by its ID or throws an exception if this category does not exist.- Specified by:
getPoiCategoryByIDin interfacePoiCategoryManager- Parameters:
id- The category's ID.- Returns:
- The category having this ID or null.
- Throws:
UnknownPoiCategoryException- if the category has not been added to thePoiCategoryManager.
-
getPoiCategoryByTitle
Returns a category given by unique title or throws an exception if this category does not exist.- Specified by:
getPoiCategoryByTitlein interfacePoiCategoryManager- Parameters:
title- The category's title- Returns:
- The category c with
c.title.equalsIgnoreCase(title). - Throws:
UnknownPoiCategoryException- if the category has not been added to thePoiCategoryManager.
-
getRootCategory
Returns the category tree's root.- Specified by:
getRootCategoryin interfacePoiCategoryManager- Returns:
- The tree's root category or null if the tree is empty.
- Throws:
UnknownPoiCategoryException- if the category has not been added to thePoiCategoryManager.
-