java.lang.Object
Model.gameClasses.CacheManager
-
Constructor Summary
ConstructorsConstructorDescriptionCacheManager(int size, CacheReplacementPolicy crp) the CacheManager constructor gets the size of the cache structure and the cacheReplacementPolicy -
Method Summary
-
Constructor Details
-
CacheManager
the CacheManager constructor gets the size of the cache structure and the cacheReplacementPolicy- Parameters:
size- the size of the cache policycrp- the cache replacement policy (LFU, LRU...)
-
-
Method Details
-
query
- Parameters:
word- a word to check if it exists in cache- Returns:
- whether the given word exists or not
-
add
- Parameters:
word- add the word to the cache and if the cache is full - remove a word using the policy of the cache.
-