Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/wangzheng0822/algo
/ removeAndCache
Method
removeAndCache
java/06_linkedlist/LRUBasedArray.java:83–87 ·
view source on GitHub ↗
缓存满的情况,踢出后,再缓存到数组头部 @param object
(T object)
Source
from the content-addressed store, hash-verified
81
* @param object
82
*/
83
public
void
removeAndCache(T object) {
84
T key = value[--count];
85
holder.remove(key);
86
cache(object, count);
87
}
88
89
/**
90
* end左边的数据统一右移一位
Callers
1
offer
Method · 0.95
Calls
2
cache
Method · 0.95
remove
Method · 0.65
Tested by
no test coverage detected