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

Method update

java/06_linkedlist/LRUBasedArray.java:60–65  ·  view source on GitHub ↗

若缓存中有指定的值,则更新位置 @param end

(int end)

Source from the content-addressed store, hash-verified

58 * @param end
59 */
60 public void update(int end) {
61 T target = value[end];
62 rightShift(end);
63 value[0] = target;
64 holder.put(target, 0);
65 }
66
67 /**
68 * 缓存数据到头部,但要先右移

Callers 1

offerMethod · 0.95

Calls 2

rightShiftMethod · 0.95
putMethod · 0.45

Tested by

no test coverage detected