java.lang.Object
model.logic.server.dictionary.LRU
- All Implemented Interfaces:
CacheReplacementPolicy
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
LRU
public LRU()The LRU function takes in a string and adds it to the LinkedHashSet. If the size of the set is greater than 10, then it removes the first element.
-
-
Method Details
-
add
The add function adds a word to the list of words.- Specified by:
addin interfaceCacheReplacementPolicy- Parameters:
word- word Add the word to the list of words
-
remove
The remove function removes the first word in the list of words.- Specified by:
removein interfaceCacheReplacementPolicy- Returns:
- The word that was removed from the words set
-