Package org.mapsforge.poi.storage
Class AbstractPoiPersistenceManager
- java.lang.Object
-
- org.mapsforge.poi.storage.AbstractPoiPersistenceManager
-
- All Implemented Interfaces:
PoiPersistenceManager
public abstract class AbstractPoiPersistenceManager extends java.lang.Object implements PoiPersistenceManager
Abstract implementation for thePoiPersistenceManagerinterface. This implementation provides functionality for accessing the SQLite database.
-
-
Field Summary
Fields Modifier and Type Field Description protected PoiCategoryManagercategoryManagerprotected PointOfInterestpoiprotected java.lang.StringpoiFileprotected PoiFileInfopoiFileInfoprotected java.util.List<PointOfInterest>ret
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractPoiPersistenceManager()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Collection<PointOfInterest>findNearPosition(org.mapsforge.core.model.LatLong point, int distance, PoiCategoryFilter filter, java.util.List<org.mapsforge.core.model.Tag> patterns, int limit)FetchPointOfInterestfrom underlying storage near a given position.PoiCategoryManagergetCategoryManager()java.lang.StringgetPoiFile()PoiFileInfogetPoiFileInfo()protected static java.lang.StringgetSQLSelectString(PoiCategoryFilter filter, int count, int version)Gets the SQL query that looks up POI entries.voidsetCategoryManager(PoiCategoryManager categoryManager)Sets this manager'sPoiCategoryManagerfor retrieving and editing POI categories.protected static java.util.Set<org.mapsforge.core.model.Tag>stringToTags(java.lang.String data)Convert tags string representation with '\r' delimiter to collection.protected static java.lang.StringtagsToString(java.util.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, wait
-
Methods inherited from interface org.mapsforge.poi.storage.PoiPersistenceManager
close, findInRect, findPointByID, insertPointOfInterest, insertPointsOfInterest, isClosed, isValidDataBase, readPoiFileInfo, removePointOfInterest
-
-
-
-
Field Detail
-
categoryManager
protected PoiCategoryManager categoryManager
-
poiFile
protected java.lang.String poiFile
-
poiFileInfo
protected PoiFileInfo poiFileInfo
-
ret
protected final java.util.List<PointOfInterest> ret
-
poi
protected PointOfInterest poi
-
-
Method Detail
-
findNearPosition
public java.util.Collection<PointOfInterest> findNearPosition(org.mapsforge.core.model.LatLong point, int distance, PoiCategoryFilter filter, java.util.List<org.mapsforge.core.model.Tag> patterns, int limit)
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).limit- max number ofPointOfInterestto be returned.- Returns:
CollectionofPointOfInterestmatching a givenPoiCategoryFilterand data pattern near the given position.
-
getCategoryManager
public PoiCategoryManager getCategoryManager()
- Specified by:
getCategoryManagerin interfacePoiPersistenceManager- Returns:
- The persistence manager's category manager for retrieving and editing POI categories.
-
getPoiFile
public java.lang.String getPoiFile()
- Specified by:
getPoiFilein interfacePoiPersistenceManager- Returns:
- the current POI file.
-
getPoiFileInfo
public PoiFileInfo getPoiFileInfo()
- Specified by:
getPoiFileInfoin interfacePoiPersistenceManager- Returns:
- the metadata for the current POI file.
-
getSQLSelectString
protected static java.lang.String getSQLSelectString(PoiCategoryFilter filter, int count, int version)
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).version- POI specification version.- Returns:
- The SQL query.
-
setCategoryManager
public void setCategoryManager(PoiCategoryManager categoryManager)
Sets this manager'sPoiCategoryManagerfor retrieving and editing POI categories.- Specified by:
setCategoryManagerin interfacePoiPersistenceManager- Parameters:
categoryManager- The category manager to be set.
-
stringToTags
protected static java.util.Set<org.mapsforge.core.model.Tag> stringToTags(java.lang.String data)
Convert tags string representation with '\r' delimiter to collection.
-
tagsToString
protected static java.lang.String tagsToString(java.util.Set<org.mapsforge.core.model.Tag> tags)
Convert tags collection to string representation with '\r' delimiter.
-
-