MfuEvictionPolicy class Null safety

Counts how often an item is needed. Those that are used most often are discarded first. This works very similar to MRU except that instead of storing the value of how recently a block was accessed, we store the value of how many times it was accessed. So of course while running an access sequence we will replace a entry which was used most number of times from our cache. E.g., if A was used (accessed) 5 times and B was used 3 times and C was used 10 times, we will replace C. This algorithm uses the CacheStat.hitCount to keep track of how many times a entry was uses.



Builds a MfuEvictionPolicy


hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
select(Iterable<CacheStat?> entries, CacheStat justAdded) CacheStat?
Finds the best eviction candidate based on the sampled entries. What distinguishes this approach from the classic data structures approach is that an CacheStat contains metadata (e.g. usage statistics) which can be used for making policy decisions, while generic data structures do not. It is expected that implementations will take advantage of that metadata. [...]
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]