Package test

Class LRU

All Implemented Interfaces:
CacheReplacementPolicy

public class LRU extends Object implements CacheReplacementPolicy
  • Constructor Details

    • LRU

      public LRU()
  • Method Details

    • getWords

      public LinkedHashSet<String> getWords()
    • add

      public void add(String word)
      The add function adds a word to the list of words.
      Specified by:
      add in interface CacheReplacementPolicy
      Parameters:
      word - Add a word to the list
    • remove

      public String remove()
      The remove function removes the first element in the list.
      Specified by:
      remove in interface CacheReplacementPolicy
      Returns:
      The first element in the set