Package com.intellij.util.containers
Class ObjectCache<K,V>
- java.lang.Object
-
- com.intellij.util.containers.ObjectCache<K,V>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
ObjectCache.CacheEntry<K,V>
static interface
ObjectCache.DeletedPairsListener
protected class
ObjectCache.ObjectCacheIterator<K,V>
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_SIZE
static int
MIN_SIZE
-
Constructor Summary
Constructors Constructor Description ObjectCache()
ObjectCache(int cacheSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method 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()
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)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Field Detail
-
DEFAULT_SIZE
public static final int DEFAULT_SIZE
- See Also:
- Constant Field Values
-
MIN_SIZE
public static final int MIN_SIZE
- See Also:
- Constant Field Values
-
-
Method Detail
-
isEmpty
public boolean isEmpty()
-
containsKey
public boolean containsKey(K key)
-
remove
public void remove(K key)
-
removeAll
public void removeAll()
-
isCached
public final boolean isCached(K key)
-
count
public int count()
-
size
public int size()
-
hitRate
public double hitRate()
-
addDeletedPairsListener
public void addDeletedPairsListener(ObjectCache.DeletedPairsListener listener)
-
removeDeletedPairsListener
public void removeDeletedPairsListener(ObjectCache.DeletedPairsListener listener)
-
getAdjustedTableSize
protected static int getAdjustedTableSize(int candidate)
-
-