RongCache

public class RongCache<K, V>

Modify by DragonJ on 14/11/28. Add queue for change the way of recycle.

Constructors

Link copied to clipboard
public void RongCache(int maxSize)

Functions

Link copied to clipboard
public void clear()
Link copied to clipboard
public final synchronized int createCount()
Returns the number of times create returned a value.
Link copied to clipboard
public final void evictAll()
Clear the cache, calling entryRemoved on each removed entry.
Link copied to clipboard
public final synchronized int evictionCount()
Returns the number of values that have been evicted.
Link copied to clipboard
public final V get(K key)
Returns the value for key if it exists in the cache or can be created by #create.
Link copied to clipboard
public final synchronized int hitCount()
Returns the number of times get returned a value that was already present in the cache.
Link copied to clipboard
public final synchronized int maxSize()
For caches that do not override sizeOf, this returns the maximum number of entries in the cache.
Link copied to clipboard
public final synchronized int missCount()
Returns the number of times get returned null or required a new value to be created.
Link copied to clipboard
public final V put(K key, V value)
Caches value for key.
Link copied to clipboard
public final synchronized int putCount()
Returns the number of times put was called.
Link copied to clipboard
public final V remove(K key)
Removes the entry for key if it exists.
Link copied to clipboard
public void resize(int maxSize)
Sets the size of the cache.
Link copied to clipboard
public final synchronized int size()
For caches that do not override sizeOf, this returns the number of entries in the cache.
Link copied to clipboard
public final synchronized Map<K, V> snapshot()
Returns a copy of the current contents of the cache, ordered from least recently accessed to most recently accessed.
Link copied to clipboard
public final synchronized String toString()