org.hibernate.util
Class LRUMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.HashMap<K,V>
java.util.LinkedHashMap
org.hibernate.util.LRUMap
- All Implemented Interfaces:
- Serializable, Cloneable, Map
public class LRUMap
- extends LinkedHashMap
- implements Serializable
A simple LRU cache that implements the Map
interface. Instances
are not thread-safe and should be synchronized externally, for instance by
using Collections.synchronizedMap(java.util.Map)
.
- Author:
- Manuel Dominguez Sarmiento
- See Also:
- Serialized Form
Constructor Summary |
LRUMap(int maxEntries)
|
Methods inherited from interface java.util.Map |
containsKey, entrySet, equals, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
LRUMap
public LRUMap(int maxEntries)
removeEldestEntry
protected boolean removeEldestEntry(Map.Entry eldest)
- Overrides:
removeEldestEntry
in class LinkedHashMap
Copyright © 2001-2010 Red Hat, Inc. All Rights Reserved.