缓存键的类型 / Type of cache keys
缓存值的类型 / Type of cache values
获取缓存的最大容量 Get the maximum capacity of the cache
缓存最大容量 / Maximum cache capacity
获取当前缓存中的元素数量 Get the number of items currently stored in the cache
当前缓存大小 / Current cache size
清空缓存中的所有数据 Clear all data in the cache
删除缓存中指定的键 Delete the specified key from the cache
删除成功时会从对应频次链表中移除节点,并在需要时更新最小频次。 When deletion succeeds, the node is removed from its frequency list and min frequency may be updated.
要删除的键 / Key to delete
如果键存在并被删除返回 true,否则返回 false / Returns true if key existed and was deleted, false otherwise
从缓存中获取指定键的值 Get the value associated with the specified key from the cache
获取操作会增加该键的访问频率(LFU 特性)。 The get operation increases the access frequency of this key (LFU behavior).
要获取的键 / Key to get
如果键存在返回对应的值,否则返回 undefined / Returns the value if key exists, otherwise undefined
检查缓存中是否存在指定的键 Check if the specified key exists in the cache
要检查的键 / Key to check
如果键存在返回 true,否则返回 false / Returns true if key exists, false otherwise
向缓存中添加或更新键值对 Add or update a key-value pair in the cache
当前缓存实例(支持链式调用)/ Current cache instance (for chaining)
LFU (Least Frequently Used) 缓存类 LFU (Least Frequently Used) Cache Class
基于最少使用次数进行淘汰的缓存实现。 Cache implementation that evicts items with the lowest access frequency.