FrecencyStore class
Tracks how often and how recently keys are used for ranking lists.
Constructors
- FrecencyStore({int maxEntries = 1000, DateTime clock()?})
Properties
-
data
→ Map<
String, FrecencyEntry> -
Snapshot of tracked entries.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- maxEntries → int
-
Soft cap on retained keys (oldest lastOpen dropped first).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clear(
) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
score(
String key, {DateTime? now}) → double -
Frecency score for
key(0 if unknown). -
sortByFrecency<
T> (Iterable< T> items, String keyOf(T item), {DateTime? now}) → List<T> -
Sort
itemsby descending frecency ofkeyOf, stable for ties. -
toString(
) → String -
A string representation of this object.
inherited
-
touch(
String key, {DateTime? now}) → void -
Record a use of
key.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited