Class ResourceCacheImpl.LRUMap<K,V>
- java.lang.Object
-
- java.util.AbstractMap<K,V>
-
- java.util.HashMap<K,V>
-
- java.util.LinkedHashMap<K,V>
-
- org.apache.velocity.runtime.resource.ResourceCacheImpl.LRUMap<K,V>
-
- Type Parameters:
K
- The key type of the map.V
- The value type of the map.
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.util.Map<K,V>
- Enclosing class:
- ResourceCacheImpl
private static class ResourceCacheImpl.LRUMap<K,V> extends java.util.LinkedHashMap<K,V>
A simple LRU Map based onLinkedHashSet
.
-
-
Field Summary
Fields Modifier and Type Field Description private int
cacheSize
The size of the cache.private static long
serialVersionUID
The serial version uid;
-
Constructor Summary
Constructors Constructor Description LRUMap(int cacheSize)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
removeEldestEntry(java.util.Map.Entry<K,V> eldest)
-
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, replaceAll, values
-
Methods inherited from class java.util.HashMap
clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
-
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
The serial version uid;- See Also:
- Constant Field Values
-
cacheSize
private int cacheSize
The size of the cache.
-
-