Class IconCache
java.lang.Object
mil.nga.geopackage.extension.nga.style.IconCache
Icon Cache of icon bitmaps
- Since:
- 3.2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default max number of icon bitmaps to retain in cache -
Constructor Summary
ConstructorDescriptionConstructor, created with cache size ofDEFAULT_CACHE_SIZE
IconCache
(int size) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the cachecreateIcon
(IconRow icon) Create or retrieve from cache an icon bitmap for the icon rowcreateIcon
(IconRow icon, float density) Create or retrieve from cache an icon bitmap for the icon rowstatic Bitmap
createIcon
(IconRow icon, float density, IconCache iconCache) Create or retrieve from cache an icon bitmap for the icon rowstatic Bitmap
createIcon
(IconRow icon, IconCache iconCache) Create or retrieve from cache an icon bitmap for the icon rowstatic Bitmap
createIconNoCache
(IconRow icon) Create an icon bitmap for the icon row without cachingstatic Bitmap
createIconNoCache
(IconRow icon, float density) Create an icon bitmap for the icon row without cachingget
(long iconRowId) Get the cached bitmap for the icon row id or null if not cachedGet the cached bitmap for the icon row or null if not cachedCache the icon bitmap for the icon row idCache the icon bitmap for the icon rowremove
(long iconRowId) Remove the cached bitmap for the icon row idRemove the cached bitmap for the icon rowvoid
resize
(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
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
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
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.density
iconCache
- icon cache- Returns:
- icon bitmap
-