-
Notifications
You must be signed in to change notification settings - Fork 0
/
MRUNodes.java
executable file
·80 lines (73 loc) · 2.16 KB
/
MRUNodes.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Decompiled by Jad v1.5.8f. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3)
import sign.signlink;
public final class MRUNodes {
public MRUNodes(int i)
{
emptyNodeSub = new NodeSub();
nodeSubList = new NodeSubList();
initialCount = i;
spaceLeft = i;
nodeCache = new NodeCache();
}
public NodeSub insertFromCache(long l)
{
NodeSub nodeSub = (NodeSub) nodeCache.findNodeByID(l);
if(nodeSub != null)
{
nodeSubList.insertHead(nodeSub);
}
return nodeSub;
}
public void removeFromCache(NodeSub nodeSub, long l)
{
try
{
if(spaceLeft == 0)
{
NodeSub nodeSub_1 = nodeSubList.popTail();
nodeSub_1.unlink();
nodeSub_1.unlinkSub();
if(nodeSub_1 == emptyNodeSub)
{
NodeSub nodeSub_2 = nodeSubList.popTail();
nodeSub_2.unlink();
nodeSub_2.unlinkSub();
}
} else
{
spaceLeft--;
}
nodeCache.removeFromCache(nodeSub, l);
nodeSubList.insertHead(nodeSub);
return;
}
catch(RuntimeException runtimeexception)
{
signlink.reporterror("47547, " + nodeSub + ", " + l + ", " + (byte)2 + ", " + runtimeexception.toString());
}
throw new RuntimeException();
}
public void unlinkAll()
{
do
{
NodeSub nodeSub = nodeSubList.popTail();
if(nodeSub != null)
{
nodeSub.unlink();
nodeSub.unlinkSub();
} else
{
spaceLeft = initialCount;
return;
}
} while(true);
}
private final NodeSub emptyNodeSub;
private final int initialCount;
private int spaceLeft;
private final NodeCache nodeCache;
private final NodeSubList nodeSubList;
}