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 (Exception runtimeexception) { signlink.reporterror("47547, " + nodeSub + ", " + l + ", " + (byte)2 + ", " + runtimeexception.Message); } throw new Exception(); }
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 int getNodeCount() { int i = 0; for (NodeSub nodeSub = head.prevNodeSub; nodeSub != head; nodeSub = nodeSub.prevNodeSub) { i++; } return(i); }
public void insertHead(NodeSub nodeSub) { if (nodeSub.nextNodeSub != null) { nodeSub.unlinkSub(); } nodeSub.nextNodeSub = head.nextNodeSub; nodeSub.prevNodeSub = head; nodeSub.nextNodeSub.prevNodeSub = nodeSub; nodeSub.prevNodeSub.nextNodeSub = nodeSub; }
public NodeSub popTail() { NodeSub nodeSub = head.prevNodeSub; if (nodeSub == head) { return(null); } else { nodeSub.unlinkSub(); return(nodeSub); } }
public NodeSub reverseGetNext() { NodeSub nodeSub = current; if (nodeSub == head) { current = null; return(null); } else { current = nodeSub.prevNodeSub; return(nodeSub); } }
public void unlinkAll() { do { NodeSub nodeSub = nodeSubList.popTail(); if (nodeSub != null) { nodeSub.unlink(); nodeSub.unlinkSub(); } else { spaceLeft = initialCount; return; } } while (true); }
public NodeSubList() { head = new NodeSub(); head.prevNodeSub = head; head.nextNodeSub = head; }