Package mil.nga.geopackage.features.user
Class FeatureCacheTables
java.lang.Object
mil.nga.geopackage.features.user.FeatureCacheTables
Feature Row Cache for multiple feature tables in a single GeoPackage
- Since:
- 3.2.0
-
Constructor Summary
ConstructorDescriptionConstructor, created with cache size ofFeatureCache.DEFAULT_CACHE_MAX_SIZE
FeatureCacheTables
(int maxCacheSize) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clear all cachesvoid
Clear the feature table cachevoid
clearAndResize
(int maxCacheSize) Clear and resize all caches and update the max cache sizevoid
clearAndResize
(String tableName, int maxCacheSize) Clear and resize the feature table cacheGet the cached feature row by table name and feature idGet or create a feature row cache for the table namegetCache
(FeatureRow featureRow) Get or create a feature row cache for the feature rowint
Get the max cache size used when creating new feature row cachesint
getMaxSize
(String tableName) Get the cache max size for the table nameint
Get the current cache size, number of feature rows cached, for the table nameGet the feature table names with a feature row cacheput
(FeatureRow featureRow) Cache the feature rowRemove the cached feature row by idremove
(FeatureRow featureRow) Remove the cached feature rowvoid
resize
(int maxCacheSize) Resize all caches and update the max cache sizevoid
Resize the feature table cachevoid
setMaxCacheSize
(int maxCacheSize) Set the max cache size to use when creating new feature row caches
-
Constructor Details
-
FeatureCacheTables
public FeatureCacheTables()Constructor, created with cache size ofFeatureCache.DEFAULT_CACHE_MAX_SIZE
-
FeatureCacheTables
public FeatureCacheTables(int maxCacheSize) Constructor- Parameters:
maxCacheSize
- max feature rows to retain in each feature table cache
-
-
Method Details
-
getMaxCacheSize
public int getMaxCacheSize()Get the max cache size used when creating new feature row caches- Returns:
- max cache size
-
setMaxCacheSize
public void setMaxCacheSize(int maxCacheSize) Set the max cache size to use when creating new feature row caches- Parameters:
maxCacheSize
- feature row max cache size
-
getTables
Get the feature table names with a feature row cache- Returns:
- feature table names
-
getCache
Get or create a feature row cache for the table name- Parameters:
tableName
- feature table name- Returns:
- feature row cache
-
getCache
Get or create a feature row cache for the feature row- Parameters:
featureRow
- feature row- Returns:
- feature row cache
-
getMaxSize
Get the cache max size for the table name- Parameters:
tableName
- feature table name- Returns:
- max size
-
getSize
Get the current cache size, number of feature rows cached, for the table name- Parameters:
tableName
- feature table name- Returns:
- cache size
-
get
Get the cached feature row by table name and feature id- Parameters:
tableName
- feature table namefeatureId
- 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:
tableName
- feature table namefeatureId
- feature row id- Returns:
- removed feature row or null
-
clear
Clear the feature table cache- Parameters:
tableName
- feature table name
-
clear
public void clear()Clear all caches -
resize
Resize the feature table cache- Parameters:
tableName
- feature table namemaxCacheSize
- max cache size
-
resize
public void resize(int maxCacheSize) Resize all caches and update the max cache size- Parameters:
maxCacheSize
- max cache size
-
clearAndResize
Clear and resize the feature table cache- Parameters:
tableName
- feature table namemaxCacheSize
- max cache size
-
clearAndResize
public void clearAndResize(int maxCacheSize) Clear and resize all caches and update the max cache size- Parameters:
maxCacheSize
- max cache size
-