Class AbstractPoiPersistenceManager

java.lang.Object
org.mapsforge.poi.storage.AbstractPoiPersistenceManager
All Implemented Interfaces:
PoiPersistenceManager

public abstract class AbstractPoiPersistenceManager extends Object implements PoiPersistenceManager
Abstract implementation for the PoiPersistenceManager interface. This implementation provides functionality for accessing the SQLite database.
  • Field Details

  • 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)
      Fetch PointOfInterest from underlying storage near a given position. Only the POIs that are allowed by the PoiCategoryFilter object and matching the data pattern will be returned.
      Specified by:
      findNearPosition in interface PoiPersistenceManager
      Parameters:
      point - LatLong center of the search.
      distance - in meters
      filter - 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 - LatLong location of the sort.
      limit - max number of PointOfInterest to be returned.
      findCategories - find POI categories.
      Returns:
      Collection of PointOfInterest matching a given PoiCategoryFilter and data pattern near the given position.
    • getCategoryManager

      public PoiCategoryManager getCategoryManager()
      Specified by:
      getCategoryManager in interface PoiPersistenceManager
      Returns:
      The persistence manager's category manager for retrieving and editing POI categories.
    • getPoiFile

      public String getPoiFile()
      Specified by:
      getPoiFile in interface PoiPersistenceManager
      Returns:
      the current POI file.
    • getPoiFileInfo

      public PoiFileInfo getPoiFileInfo()
      Specified by:
      getPoiFileInfo in interface PoiPersistenceManager
      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 - LatLong location of the sort.
      Returns:
      The SQL query.
    • setCategoryManager

      public void setCategoryManager(PoiCategoryManager categoryManager)
      Sets this manager's PoiCategoryManager for retrieving and editing POI categories.
      Specified by:
      setCategoryManager in interface PoiPersistenceManager
      Parameters:
      categoryManager - The category manager to be set.
    • stringToTags

      protected static Set<org.mapsforge.core.model.Tag> stringToTags(String data)
      Convert tags string representation with '\r' delimiter to collection.
    • tagsToString

      protected static String tagsToString(Set<org.mapsforge.core.model.Tag> tags)
      Convert tags collection to string representation with '\r' delimiter.