freemarker.ext.util
Class CacheMapLRU<K,V>
java.lang.Object
freemarker.ext.util.CacheMapLRU<K,V>
public class CacheMapLRU<K,V>
- extends java.lang.Object
A simple cache of fixed size that implements a least recently used algorithm.
The access is unsyncrhonized. The default capacity of the cache is of ten
items. Attempts to store more than ten unique keys will result in the least
recently used item being evicted, and the new item inserted in its place.
Keys are assumed to always be non-null
values.
- Since:
- 1.9
- Version:
- $Id: CacheMapLRU.java 1090 2013-03-29 11:04:07Z run2000 $
- Author:
- Nicholas Cull
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DEFAULT_CAPACITY
public static final int DEFAULT_CAPACITY
- See Also:
- Constant Field Values
CacheMapLRU
public CacheMapLRU()
CacheMapLRU
public CacheMapLRU(int capacity)
get
public V get(K key)
put
public void put(K key,
V value)
clear
public void clear()