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:
Serializable, Cloneable, Map<K,V>, SequencedMap<K,V>
Enclosing class:
ResourceCacheImpl

private static class ResourceCacheImpl.LRUMap<K,V> extends LinkedHashMap<K,V>
A simple LRU Map based on LinkedHashSet.
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      The serial version uid;
      See Also:
    • cacheSize

      private int cacheSize
      The size of the cache.
  • Constructor Details

    • LRUMap

      public LRUMap(int cacheSize)
      Constructor.
      Parameters:
      cacheSize - The size of the cache. After reaching this size, the eldest-accessed element will be erased.
  • Method Details