Package org.mapsforge.poi.storage
Class AbstractPoiPersistenceManager
java.lang.Object
org.mapsforge.poi.storage.AbstractPoiPersistenceManager
- All Implemented Interfaces:
PoiPersistenceManager
Abstract implementation for the
PoiPersistenceManager interface. This implementation
provides functionality for accessing the SQLite database.-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected PoiCategoryManagerprotected PointOfInterestprotected Stringprotected PoiFileInfoprotected final List<PointOfInterest> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfindNearPosition(org.mapsforge.core.model.LatLong point, int distance, PoiCategoryFilter filter, List<org.mapsforge.core.model.Tag> patterns, org.mapsforge.core.model.LatLong orderBy, int limit, boolean findCategories) FetchPointOfInterestfrom underlying storage near a given position.protected static StringgetSQLSelectString(PoiCategoryFilter filter, int count, org.mapsforge.core.model.LatLong orderBy) Gets the SQL query that looks up POI entries.voidsetCategoryManager(PoiCategoryManager categoryManager) Sets this manager'sPoiCategoryManagerfor retrieving and editing POI categories.protected static Set<org.mapsforge.core.model.Tag>stringToTags(String data) Convert tags string representation with '\r' delimiter to collection.protected static StringtagsToString(Set<org.mapsforge.core.model.Tag> tags) Convert tags collection to string representation with '\r' delimiter.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.mapsforge.poi.storage.PoiPersistenceManager
close, findInRect, findPointByID, insertPointOfInterest, insertPointsOfInterest, isClosed, isValidDataBase, readPoiFileInfo, removePointOfInterest
-
Field Details
-
categoryManager
-
poiFile
-
poiFileInfo
-
ret
-
poi
-
-
Constructor Details
-
AbstractPoiPersistenceManager
protected AbstractPoiPersistenceManager()
-
-
Method Details
-
findNearPosition
public Collection<PointOfInterest> findNearPosition(org.mapsforge.core.model.LatLong point, int distance, PoiCategoryFilter filter, List<org.mapsforge.core.model.Tag> patterns, org.mapsforge.core.model.LatLong orderBy, int limit, boolean findCategories) FetchPointOfInterestfrom underlying storage near a given position. Only the POIs that are allowed by thePoiCategoryFilterobject and matching the data pattern will be returned.- Specified by:
findNearPositionin interfacePoiPersistenceManager- Parameters:
point-LatLongcenter of the search.distance- in metersfilter- POI category filter object that helps determining whether a POI should be added to the set or not (may be null).patterns- the patterns to search in points of interest data (may be null).orderBy-LatLonglocation of the sort.limit- max number ofPointOfInterestto be returned.findCategories- find POI categories.- Returns:
CollectionofPointOfInterestmatching a givenPoiCategoryFilterand data pattern near the given position.
-
getCategoryManager
- Specified by:
getCategoryManagerin interfacePoiPersistenceManager- Returns:
- The persistence manager's category manager for retrieving and editing POI categories.
-
getPoiFile
- Specified by:
getPoiFilein interfacePoiPersistenceManager- Returns:
- the current POI file.
-
getPoiFileInfo
- Specified by:
getPoiFileInfoin interfacePoiPersistenceManager- Returns:
- the metadata for the current POI file.
-
getSQLSelectString
protected static String getSQLSelectString(PoiCategoryFilter filter, int count, org.mapsforge.core.model.LatLong orderBy) Gets the SQL query that looks up POI entries.- Parameters:
filter- The filter object for determining all wanted categories (may be null).count- Count of patterns to search in points of interest data (may be 0).orderBy-LatLonglocation of the sort.- Returns:
- The SQL query.
-
setCategoryManager
Sets this manager'sPoiCategoryManagerfor retrieving and editing POI categories.- Specified by:
setCategoryManagerin interfacePoiPersistenceManager- Parameters:
categoryManager- The category manager to be set.
-
stringToTags
Convert tags string representation with '\r' delimiter to collection. -
tagsToString
Convert tags collection to string representation with '\r' delimiter.
-