public class FeatureCache extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_MAX_SIZE
Default max number of feature rows to retain in cache
|
| Constructor and Description |
|---|
FeatureCache()
Constructor, created with cache max size of
DEFAULT_CACHE_MAX_SIZE |
FeatureCache(int maxSize)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clear the cache
|
void |
clearAndResize(int maxSize)
Clear and resize the cache
|
FeatureRow |
get(long featureId)
Get the cached feature row by feature id
|
int |
getMaxSize()
Get the cache max size
|
int |
getSize()
Get the current cache size, number of feature rows cached
|
FeatureRow |
put(FeatureRow featureRow)
Cache the feature row
|
FeatureRow |
remove(FeatureRow featureRow)
Remove the cached feature row
|
FeatureRow |
remove(long featureId)
Remove the cached feature row by id
|
void |
resize(int maxSize)
Resize the cache
|
public static final int DEFAULT_CACHE_MAX_SIZE
public FeatureCache()
DEFAULT_CACHE_MAX_SIZEpublic FeatureCache(int maxSize)
maxSize - max feature rows to retain in the cachepublic int getMaxSize()
public int getSize()
public FeatureRow get(long featureId)
featureId - feature row idpublic FeatureRow put(FeatureRow featureRow)
featureRow - feature rowpublic FeatureRow remove(FeatureRow featureRow)
featureRow - feature rowpublic FeatureRow remove(long featureId)
featureId - feature row idpublic void clear()
public void resize(int maxSize)
maxSize - max sizepublic void clearAndResize(int maxSize)
maxSize - max size of the cache