Class LRU

java.lang.Object
Model.gameClasses.LRU
All Implemented Interfaces:
CacheReplacementPolicy

public class LRU extends Object implements CacheReplacementPolicy
  • Constructor Details

    • LRU

      public LRU()
  • Method Details

    • check

      public boolean check(String word)
      Parameters:
      word - a word that has been asked
      Returns:
      whether the word exists or not
    • add

      public void add(String word)
      Specified by:
      add in interface CacheReplacementPolicy
      Parameters:
      word - a word to be added to LRU cache
    • remove

      public String remove()
      Specified by:
      remove in interface CacheReplacementPolicy
      Returns:
      the word that has been removed from the cache