Class LRUCache<K,V>
java.lang.Object
net.sf.saxon.expr.sort.LRUCache<K,V>
An LRU cache, based on
LinkedHashMap.
Synthesized and simplified from various published examples of the genre.
The methods are not synchronized.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LRUCache
public LRUCache(int cacheSize) Creates a new LRU cache.- Parameters:
cacheSize- the maximum number of entries that will be kept in this cache.
-
LRUCache
public LRUCache(int cacheSize, boolean concurrent) Creates a new LRU cache with the option of synchronization.- Parameters:
cacheSize- the maximum number of entries that will be kept in this cache.
-
-
Method Details
-
get
-
put
-
clear
public void clear()Clear the cache -
size
public int size()Get the number of entries in the cache
-