Class LRUCache<K,​V>

    • Constructor Detail

      • LRUCache

        public LRUCache()
        Default constructor for an LRU Cache The default capacity is 10000
      • LRUCache

        public LRUCache​(int maximumCacheSize)
        Constructs a LRUCache with a maximum capacity
        Parameters:
        maximumCacheSize -
      • LRUCache

        public LRUCache​(int initialCapacity,
                        int maximumCacheSize,
                        float loadFactor,
                        boolean accessOrder)
        Constructs an empty LRUCache instance with the specified initial capacity, maximumCacheSize,load factor and ordering mode.
        Parameters:
        initialCapacity - the initial capacity.
        maximumCacheSize -
        loadFactor - the load factor.
        accessOrder - the ordering mode - true for access-order, false for insertion-order.
        Throws:
        IllegalArgumentException - if the initial capacity is negative or the load factor is non-positive.