org.eclipse.core.internal.utils
Class Cache
java.lang.Object
org.eclipse.core.internal.utils.Cache
public class Cache
- extends java.lang.Object
A cache that keeps a collection of at most maximumCapacity+threshold entries.
When the number of entries exceeds that limit, least recently used entries are removed
so the current size is the same as the maximum capacity.
Constructor Summary |
Cache(int maximumCapacity)
|
Cache(int initialCapacity,
int maximumCapacity,
double threshold)
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Cache
public Cache(int maximumCapacity)
Cache
public Cache(int initialCapacity,
int maximumCapacity,
double threshold)
addEntry
public void addEntry(java.lang.Object key,
java.lang.Object toCache)
addEntry
public Cache.Entry addEntry(java.lang.Object key,
java.lang.Object toCache,
long timestamp)
getEntry
public Cache.Entry getEntry(java.lang.Object key)
getEntry
public Cache.Entry getEntry(java.lang.Object key,
boolean update)
getHead
public Cache.Entry getHead()
getTail
public Cache.Entry getTail()
size
public long size()
discardAll
public void discardAll()
dispose
public void dispose()