# RongCache

public class RongCache<K, V>

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

## Constructors

RongCache
Link copied to clipboard
public void RongCache(int maxSize)

## Functions

clear
Link copied to clipboard
public void clear()
createCount
Link copied to clipboard
public final synchronized int createCount()
Returns the number of times create returned a value.
evictAll
Link copied to clipboard
public final void evictAll()
Clear the cache, calling entryRemoved on each removed entry.
evictionCount
Link copied to clipboard
public final synchronized int evictionCount()
Returns the number of values that have been evicted.
get
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`.
hitCount
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.
maxSize
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.
missCount
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.
put
Link copied to clipboard
public final V put(K key, V value)
Caches `value` for `key`.
putCount
Link copied to clipboard
public final synchronized int putCount()
Returns the number of times put was called.
remove
Link copied to clipboard
public final V remove(K key)
Removes the entry for `key` if it exists.
resize
Link copied to clipboard
public void resize(int maxSize)
Sets the size of the cache.
size
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.
snapshot
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.
toString
Link copied to clipboard
public final synchronized String toString()