Skip navigation links
EDB/Java
jp.ac.tokushima_u.db.common

Class LRUCache<K,V>

  • All Implemented Interfaces:
    Serializable, Cloneable, Map<K,V>


    public class LRUCache<K,V>
    extends LinkedHashMap<K,V>
    Least Recently Used (LRU) / First In First Out (FIFO) Cache. $Id: LRUCache.java,v 1.4 2020/12/25 01:46:10 alex Exp $
    See Also:
    Serialized Form
    • Field Detail

      • capacity

        protected int capacity
    • Constructor Detail

      • LRUCache

        public LRUCache(int cap,
                        boolean accessOrder)
        LinkedHashMap(16, 0.75F, accessOrder).
        Parameters:
        cap - capacity of this cache. (0 means infinite capacity)
        accessOrder - cache behavior LRU / FIFO. true... LRU, false... FIFO.
      • LRUCache

        public LRUCache(int cap)
        LinkedHashMap(16, 0.75F, true).
        Parameters:
        cap - capacity of this cache. (0 means infinite capacity)
    • Method Detail

      • setCapacity

        public void setCapacity(int cap)
        Set capacity of cache.
        Parameters:
        cap - new capacity of this cache. (0 means infinite capacity)
EDB/Java

EDB Working Group at Tue Jun 10 17:08:59 JST 2025