ch.bind.philib.cache
| Modifier and Type | Field and Description |
|---|---|
static int |
DEFAULT_OLD_GEN_AFTER_HITS
The number of hits after which an entry is put into the old-generation lru
|
static double |
DEFAULT_OLD_GEN_RATIO
The default capacity of an object cache relative to its capacity.
|
DEFAULT_CAPACITY| Constructor and Description |
|---|
StagedLruCache() |
StagedLruCache(Cloner<V> valueCloner) |
StagedLruCache(int capacity) |
StagedLruCache(int capacity,
Cloner<V> valueCloner,
double oldGenRatio,
int oldGenAfterHits) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
set(K key,
V value)
Sets a key-value-pair to the cache.
|
public static final double DEFAULT_OLD_GEN_RATIO
public static final int DEFAULT_OLD_GEN_AFTER_HITS
public StagedLruCache()
public StagedLruCache(int capacity)
public void set(K key, V value)
Cachepublic V get(K key)
Cachepublic void remove(K key)
Cachepublic int capacity()
Copyright © 2013. All Rights Reserved.