Class LruList<E extends LruNode>

    • Constructor Detail

      • LruList

        public LruList​(int capacity)
    • Method Detail

      • add

        public E add​(E node)
        Add a new LruNode to the head of the LRU.
        Parameters:
        node - The new head of the LruList.
        Returns:
        null if the the size after adding the new LruNode does not exceed this list's capacity. Otherwise the list will remove the tail (the element which wasn't accessed for the longest amount of time) and return it.
      • remove

        public void remove​(E node)
      • removeTail

        public E removeTail()
      • moveToHead

        public void moveToHead​(E node)
      • clear

        public void clear()
      • size

        public int size()
      • capacity

        public int capacity()
      • hasSpace

        public boolean hasSpace()