java.lang.Object
Model.gameClasses.Dictionary
-
Constructor Summary
ConstructorsConstructorDescriptionDictionary(String... fileNames) The Dictionary constructor gets string(s) of file(s) name(s) and create a LRU cache for placing the exist words and LFU for the notExists -
Method Summary
-
Constructor Details
-
Dictionary
The Dictionary constructor gets string(s) of file(s) name(s) and create a LRU cache for placing the exist words and LFU for the notExists- Parameters:
fileNames- array of given name(s) of file(s)
-
-
Method Details
-
query
check if the word has been asked recently, if not - searching it line by line (and add to the relevant cache)- Parameters:
word- the word we want to ask for.- Returns:
- true if the word is valid, false if invalid
-
challenge
- Parameters:
word- to check with IO searching- Returns:
- if the word is in the "BOOKS" by searching it line by line - and add the word to the relevant cache.
-