Class IconCache

java.lang.Object
mil.nga.geopackage.extension.nga.style.IconCache

public class IconCache extends Object
Icon Cache of icon bitmaps
Since:
3.2.0
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    Default max number of icon bitmaps to retain in cache
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor, created with cache size of DEFAULT_CACHE_SIZE
    IconCache(int size)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clear the cache
    android.graphics.Bitmap
    Create or retrieve from cache an icon bitmap for the icon row
    android.graphics.Bitmap
    createIcon(IconRow icon, float density)
    Create or retrieve from cache an icon bitmap for the icon row
    static android.graphics.Bitmap
    createIcon(IconRow icon, float density, IconCache iconCache)
    Create or retrieve from cache an icon bitmap for the icon row
    static android.graphics.Bitmap
    createIcon(IconRow icon, IconCache iconCache)
    Create or retrieve from cache an icon bitmap for the icon row
    static android.graphics.Bitmap
    Create an icon bitmap for the icon row without caching
    static android.graphics.Bitmap
    createIconNoCache(IconRow icon, float density)
    Create an icon bitmap for the icon row without caching
    android.graphics.Bitmap
    get(long iconRowId)
    Get the cached bitmap for the icon row id or null if not cached
    android.graphics.Bitmap
    get(IconRow iconRow)
    Get the cached bitmap for the icon row or null if not cached
    android.graphics.Bitmap
    put(long iconRowId, android.graphics.Bitmap bitmap)
    Cache the icon bitmap for the icon row id
    android.graphics.Bitmap
    put(IconRow iconRow, android.graphics.Bitmap bitmap)
    Cache the icon bitmap for the icon row
    android.graphics.Bitmap
    remove(long iconRowId)
    Remove the cached bitmap for the icon row id
    android.graphics.Bitmap
    remove(IconRow iconRow)
    Remove the cached bitmap for the icon row
    void
    resize(int maxSize)
    Resize the cache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • DEFAULT_CACHE_SIZE

      public static final int DEFAULT_CACHE_SIZE
      Default max number of icon bitmaps to retain in cache
      See Also:
  • Constructor Details

    • IconCache

      public IconCache()
      Constructor, created with cache size of DEFAULT_CACHE_SIZE
    • IconCache

      public IconCache(int size)
      Constructor
      Parameters:
      size - max icon bitmaps to retain in the cache
  • Method Details

    • get

      public android.graphics.Bitmap get(IconRow iconRow)
      Get the cached bitmap for the icon row or null if not cached
      Parameters:
      iconRow - icon row
      Returns:
      icon bitmap or null
    • get

      public android.graphics.Bitmap get(long iconRowId)
      Get the cached bitmap for the icon row id or null if not cached
      Parameters:
      iconRowId - icon row id
      Returns:
      icon bitmap or null
    • put

      public android.graphics.Bitmap put(IconRow iconRow, android.graphics.Bitmap bitmap)
      Cache the icon bitmap for the icon row
      Parameters:
      iconRow - icon row
      bitmap - icon bitmap
      Returns:
      previous cached icon bitmap or null
    • put

      public android.graphics.Bitmap put(long iconRowId, android.graphics.Bitmap bitmap)
      Cache the icon bitmap for the icon row id
      Parameters:
      iconRowId - icon row id
      bitmap - icon bitmap
      Returns:
      previous cached icon bitmap or null
    • remove

      public android.graphics.Bitmap remove(IconRow iconRow)
      Remove the cached bitmap for the icon row
      Parameters:
      iconRow - icon row
      Returns:
      removed icon bitmap or null
    • remove

      public android.graphics.Bitmap remove(long iconRowId)
      Remove the cached bitmap for the icon row id
      Parameters:
      iconRowId - icon row id
      Returns:
      removed icon bitmap or null
    • clear

      public void clear()
      Clear the cache
    • resize

      public void resize(int maxSize)
      Resize the cache
      Parameters:
      maxSize - max size
    • createIcon

      public android.graphics.Bitmap createIcon(IconRow icon)
      Create or retrieve from cache an icon bitmap for the icon row
      Parameters:
      icon - icon row
      Returns:
      icon bitmap
    • createIcon

      public android.graphics.Bitmap createIcon(IconRow icon, float density)
      Create or retrieve from cache an icon bitmap for the icon row
      Parameters:
      icon - icon row
      density - display density: DisplayMetrics.density
      Returns:
      icon bitmap
    • createIconNoCache

      public static android.graphics.Bitmap createIconNoCache(IconRow icon)
      Create an icon bitmap for the icon row without caching
      Parameters:
      icon - icon row
      Returns:
      icon bitmap
    • createIconNoCache

      public static android.graphics.Bitmap createIconNoCache(IconRow icon, float density)
      Create an icon bitmap for the icon row without caching
      Parameters:
      icon - icon row
      density - display density: DisplayMetrics.density
      Returns:
      icon bitmap
    • createIcon

      public static android.graphics.Bitmap createIcon(IconRow icon, IconCache iconCache)
      Create or retrieve from cache an icon bitmap for the icon row
      Parameters:
      icon - icon row
      iconCache - icon cache
      Returns:
      icon bitmap
    • createIcon

      public static android.graphics.Bitmap createIcon(IconRow icon, float density, IconCache iconCache)
      Create or retrieve from cache an icon bitmap for the icon row
      Parameters:
      icon - icon row
      density - display density: DisplayMetrics.density
      iconCache - icon cache
      Returns:
      icon bitmap