Class TileBasedLabelStore

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<org.mapsforge.core.model.Tile,​java.util.List<org.mapsforge.core.mapelements.MapElementContainer>>, LabelStore

    public class TileBasedLabelStore
    extends org.mapsforge.core.util.WorkingSetCache<org.mapsforge.core.model.Tile,​java.util.List<org.mapsforge.core.mapelements.MapElementContainer>>
    implements LabelStore
    A LabelStore where the data is stored per tile.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Field Summary

      • Fields inherited from class org.mapsforge.core.util.LRUCache

        capacity
    • Constructor Summary

      Constructors 
      Constructor Description
      TileBasedLabelStore​(int capacity)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void destroy()  
      int getVersion()
      Returns a version number, which changes every time an update is made to the LabelStore.
      java.util.List<org.mapsforge.core.mapelements.MapElementContainer> getVisibleItems​(org.mapsforge.core.model.Tile upperLeft, org.mapsforge.core.model.Tile lowerRight)
      Gets the items that are visible on a set of tiles.
      protected boolean removeEldestEntry​(java.util.Map.Entry<org.mapsforge.core.model.Tile,​java.util.List<org.mapsforge.core.mapelements.MapElementContainer>> eldest)  
      boolean requiresTile​(org.mapsforge.core.model.Tile tile)
      Returns if a tile is in the current tile set and no data is stored for this tile.
      void storeMapItems​(org.mapsforge.core.model.Tile tile, java.util.List<org.mapsforge.core.mapelements.MapElementContainer> mapItems)
      Stores a list of MapElements against a tile.
      • Methods inherited from class org.mapsforge.core.util.WorkingSetCache

        setWorkingSet
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface org.mapsforge.map.layer.labels.LabelStore

        clear
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
    • Constructor Detail

      • TileBasedLabelStore

        public TileBasedLabelStore​(int capacity)
    • Method Detail

      • destroy

        public void destroy()
      • storeMapItems

        public void storeMapItems​(org.mapsforge.core.model.Tile tile,
                                  java.util.List<org.mapsforge.core.mapelements.MapElementContainer> mapItems)
        Stores a list of MapElements against a tile.
        Parameters:
        tile - tile on which the mapItems reside.
        mapItems - the map elements.
      • getVersion

        public int getVersion()
        Description copied from interface: LabelStore
        Returns a version number, which changes every time an update is made to the LabelStore.
        Specified by:
        getVersion in interface LabelStore
        Returns:
        the version number
      • getVisibleItems

        public java.util.List<org.mapsforge.core.mapelements.MapElementContainer> getVisibleItems​(org.mapsforge.core.model.Tile upperLeft,
                                                                                                  org.mapsforge.core.model.Tile lowerRight)
        Description copied from interface: LabelStore
        Gets the items that are visible on a set of tiles.
        Specified by:
        getVisibleItems in interface LabelStore
        Parameters:
        upperLeft - tile in upper left corner of visible area.
        lowerRight - tile in lower right corner of visible area.
        Returns:
        a list of MapElements that are visible on the tiles.
      • requiresTile

        public boolean requiresTile​(org.mapsforge.core.model.Tile tile)
        Returns if a tile is in the current tile set and no data is stored for this tile.
        Parameters:
        tile - the tile
        Returns:
        true if the tile is in the current tile set, but no data is stored for it.
      • removeEldestEntry

        protected boolean removeEldestEntry​(java.util.Map.Entry<org.mapsforge.core.model.Tile,​java.util.List<org.mapsforge.core.mapelements.MapElementContainer>> eldest)
        Overrides:
        removeEldestEntry in class org.mapsforge.core.util.LRUCache<org.mapsforge.core.model.Tile,​java.util.List<org.mapsforge.core.mapelements.MapElementContainer>>