Package mil.nga.geopackage.features.user
Class FeatureCache
java.lang.Object
mil.nga.geopackage.features.user.FeatureCache
Feature Row Cache for a single feature table
- Since:
- 3.2.0
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default max number of feature rows to retain in cache -
Constructor Summary
ConstructorDescriptionConstructor, created with cache max size ofDEFAULT_CACHE_MAX_SIZE
FeatureCache
(int maxSize) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear the cachevoid
clearAndResize
(int maxSize) Clear and resize the cacheget
(long featureId) Get the cached feature row by feature idint
Get the cache max sizeint
getSize()
Get the current cache size, number of feature rows cachedput
(FeatureRow featureRow) Cache the feature rowremove
(long featureId) Remove the cached feature row by idremove
(FeatureRow featureRow) Remove the cached feature rowvoid
resize
(int maxSize) Resize the cache
-
Field Details
-
DEFAULT_CACHE_MAX_SIZE
public static final int DEFAULT_CACHE_MAX_SIZEDefault max number of feature rows to retain in cache- See Also:
-
-
Constructor Details
-
FeatureCache
public FeatureCache()Constructor, created with cache max size ofDEFAULT_CACHE_MAX_SIZE
-
FeatureCache
public FeatureCache(int maxSize) Constructor- Parameters:
maxSize
- max feature rows to retain in the cache
-
-
Method Details
-
getMaxSize
public int getMaxSize()Get the cache max size- Returns:
- max size
-
getSize
public int getSize()Get the current cache size, number of feature rows cached- Returns:
- cache size
-
get
Get the cached feature row by feature id- Parameters:
featureId
- feature row id- Returns:
- feature row or null
-
put
Cache the feature row- Parameters:
featureRow
- feature row- Returns:
- previous cached feature row or null
-
remove
Remove the cached feature row- Parameters:
featureRow
- feature row- Returns:
- removed feature row or null
-
remove
Remove the cached feature row by id- Parameters:
featureId
- feature row id- Returns:
- removed feature row or null
-
clear
public void clear()Clear the cache -
resize
public void resize(int maxSize) Resize the cache- Parameters:
maxSize
- max size
-
clearAndResize
public void clearAndResize(int maxSize) Clear and resize the cache- Parameters:
maxSize
- max size of the cache
-