at.tuwien.ifs.somtoolbox.util
Class LeastRecentelyUsedImageCache
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap<String,BufferedImage>
at.tuwien.ifs.somtoolbox.util.LeastRecentelyUsedImageCache
- All Implemented Interfaces:
- Serializable, Cloneable, Map<String,BufferedImage>
public final class LeastRecentelyUsedImageCache
- extends LinkedHashMap<String,BufferedImage>
A least-recently-used LRU cache, based on LinkedHashMap
. This cache can hold a fixed a number of
BufferedImage
elements, until the specified memory limit is reached. If a new element is added, and the cache
is full, the least recently used entry is removed.
- Version:
- $Id: LeastRecentelyUsedImageCache.java 3601 2010-06-23 13:40:28Z mayer $
- Author:
- Rudolf Mayer
- See Also:
- Serialized Form
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
maxCacheSize
private long maxCacheSize
maxCacheSizeReadable
private String maxCacheSizeReadable
LeastRecentelyUsedImageCache
public LeastRecentelyUsedImageCache(long maxCacheSize)
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry<String,BufferedImage> eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap<String,BufferedImage>