|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.sort.LRUCache
public class LRUCache
An LRU cache, based on LinkedHashMap
.
Synthesized and simplified from various published examples of the genre.
The methods are not synchronized.
Constructor Summary | |
---|---|
LRUCache(int cacheSize)
Creates a new LRU cache. |
Method Summary | |
---|---|
void |
clear()
Clear the cache |
Object |
get(Object key)
Retrieves an entry from the cache. The retrieved entry becomes the most recently used entry. |
void |
put(Object key,
Object value)
Adds an entry to this cache. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LRUCache(int cacheSize)
cacheSize
- the maximum number of entries that will be kept in this cache.Method Detail |
---|
public Object get(Object key)
key
- the key whose associated value is to be returned.
public void put(Object key, Object value)
key
- the key with which the specified value is to be associated.value
- a value to be associated with the specified key.public void clear()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |