MCPcopy
hub / github.com/wangzheng0822/algo / cache

Method cache

java/06_linkedlist/LRUBasedArray.java:72–77  ·  view source on GitHub ↗

缓存数据到头部,但要先右移 @param object @param end 数组右移的边界

(T object, int end)

Source from the content-addressed store, hash-verified

70 * @param end 数组右移的边界
71 */
72 public void cache(T object, int end) {
73 rightShift(end);
74 value[0] = object;
75 holder.put(object, 0);
76 count++;
77 }
78
79 /**
80 * 缓存满的情况,踢出后,再缓存到数组头部

Callers 2

offerMethod · 0.95
removeAndCacheMethod · 0.95

Calls 2

rightShiftMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected