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