| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_CACHE_CAPACITY
The default capacity of an object cache.
|
static int |
DEFAULT_OLD_GEN_AFTER_HITS |
static double |
DEFAULT_OLD_GEN_RATIO
The default capacity of an object cache.
|
static int |
MIN_CACHE_CAPACITY
The minimum capacity of a staged cache.
|
| Constructor and Description |
|---|
StagedCache() |
StagedCache(int capacity) |
StagedCache(int capacity,
double oldGenRatio) |
StagedCache(int capacity,
double oldGenRatio,
int oldGenAfterHits) |
StagedCache(int capacity,
double oldGenRatio,
int oldGenAfterHits,
Cloner<V> cloner) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(K key,
V value)
Add a key-value-pair to the cache.
|
int |
capacity() |
void |
clear()
Remove all elements from the cache.
|
V |
get(K key)
Query a value from the cache by its key.
|
void |
remove(K key)
Remove a key-value-pair from the cache.
|
public static final int MIN_CACHE_CAPACITY
public static final int DEFAULT_CACHE_CAPACITY
public static final double DEFAULT_OLD_GEN_RATIO
public static final int DEFAULT_OLD_GEN_AFTER_HITS
public StagedCache()
public StagedCache(int capacity)
public StagedCache(int capacity,
double oldGenRatio)
public StagedCache(int capacity,
double oldGenRatio,
int oldGenAfterHits)
public void add(K key, V value)
Cachepublic V get(K key)
Cachepublic void remove(K key)
Cachepublic int capacity()
Copyright © 2012. All Rights Reserved.