public class ObjectCache<K,V>
extends java.lang.Object
implements java.lang.Iterable<V>
Modifier and Type | Class and Description |
---|---|
protected static class |
ObjectCache.CacheEntry<K,V> |
static interface |
ObjectCache.DeletedPairsListener |
protected static class |
ObjectCache.ObjectCacheIterator<K,V> |
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE |
static int |
MIN_SIZE |
Constructor and Description |
---|
ObjectCache() |
ObjectCache(int cacheSize) |
Modifier and Type | Method and Description |
---|---|
void |
addDeletedPairsListener(ObjectCache.DeletedPairsListener listener) |
void |
cacheObject(K key,
V x) |
boolean |
containsKey(K key) |
int |
count() |
V |
get(K key) |
protected static int |
getAdjustedTableSize(int candidate) |
double |
hitRate() |
boolean |
isCached(K key) |
boolean |
isEmpty() |
java.util.Iterator<V> |
iterator() |
V |
put(K key,
V value) |
void |
remove(K key) |
void |
removeAll() |
void |
removeDeletedPairsListener(ObjectCache.DeletedPairsListener listener) |
int |
size() |
V |
tryKey(K key) |
public static final int DEFAULT_SIZE
public static final int MIN_SIZE
public boolean isEmpty()
public boolean containsKey(K key)
public void remove(K key)
public void removeAll()
public final boolean isCached(K key)
public int count()
public int size()
public double hitRate()
public java.util.Iterator<V> iterator()
iterator
in interface java.lang.Iterable<V>
public void addDeletedPairsListener(ObjectCache.DeletedPairsListener listener)
public void removeDeletedPairsListener(ObjectCache.DeletedPairsListener listener)
protected static int getAdjustedTableSize(int candidate)