Class IconCache
java.lang.Object
mil.nga.geopackage.extension.nga.style.IconCache
Icon Cache of icon bitmaps
- Since:
- 3.2.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault max number of icon bitmaps to retain in cache -
Constructor Summary
ConstructorsConstructorDescriptionConstructor, created with cache size ofDEFAULT_CACHE_SIZEIconCache(int size) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear the cacheandroid.graphics.BitmapcreateIcon(IconRow icon) Create or retrieve from cache an icon bitmap for the icon rowandroid.graphics.BitmapcreateIcon(IconRow icon, float density) Create or retrieve from cache an icon bitmap for the icon rowstatic android.graphics.BitmapcreateIcon(IconRow icon, float density, IconCache iconCache) Create or retrieve from cache an icon bitmap for the icon rowstatic android.graphics.BitmapcreateIcon(IconRow icon, IconCache iconCache) Create or retrieve from cache an icon bitmap for the icon rowstatic android.graphics.BitmapcreateIconNoCache(IconRow icon) Create an icon bitmap for the icon row without cachingstatic android.graphics.BitmapcreateIconNoCache(IconRow icon, float density) Create an icon bitmap for the icon row without cachingandroid.graphics.Bitmapget(long iconRowId) Get the cached bitmap for the icon row id or null if not cachedandroid.graphics.BitmapGet the cached bitmap for the icon row or null if not cachedandroid.graphics.Bitmapput(long iconRowId, android.graphics.Bitmap bitmap) Cache the icon bitmap for the icon row idandroid.graphics.BitmapCache the icon bitmap for the icon rowandroid.graphics.Bitmapremove(long iconRowId) Remove the cached bitmap for the icon row idandroid.graphics.BitmapRemove the cached bitmap for the icon rowvoidresize(int maxSize) Resize the cache
-
Field Details
-
DEFAULT_CACHE_SIZE
public static final int DEFAULT_CACHE_SIZEDefault max number of icon bitmaps to retain in cache- See Also:
-
-
Constructor Details
-
IconCache
public IconCache()Constructor, created with cache size ofDEFAULT_CACHE_SIZE -
IconCache
public IconCache(int size) Constructor- Parameters:
size- max icon bitmaps to retain in the cache
-
-
Method Details
-
get
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
Cache the icon bitmap for the icon row- Parameters:
iconRow- icon rowbitmap- 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 idbitmap- icon bitmap- Returns:
- previous cached icon bitmap or null
-
remove
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
Create or retrieve from cache an icon bitmap for the icon row- Parameters:
icon- icon row- Returns:
- icon bitmap
-
createIcon
Create or retrieve from cache an icon bitmap for the icon row- Parameters:
icon- icon rowdensity- display density:DisplayMetrics.density- Returns:
- icon bitmap
-
createIconNoCache
Create an icon bitmap for the icon row without caching- Parameters:
icon- icon row- Returns:
- icon bitmap
-
createIconNoCache
Create an icon bitmap for the icon row without caching- Parameters:
icon- icon rowdensity- display density:DisplayMetrics.density- Returns:
- icon bitmap
-
createIcon
Create or retrieve from cache an icon bitmap for the icon row- Parameters:
icon- icon rowiconCache- icon cache- Returns:
- icon bitmap
-
createIcon
Create or retrieve from cache an icon bitmap for the icon row- Parameters:
icon- icon rowdensity- display density:DisplayMetrics.densityiconCache- icon cache- Returns:
- icon bitmap
-