// 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 NodeCache {

    public NodeCache()
    {
        int i = 1024;//was parameter
        boolean aBoolean37 = false;
        int anInt38 = -373;
        size = i;
        cache = new Node[i];
        for(int k = 0; k < i; k++)
        {
            Node node = cache[k] = new Node();
            node.prev = node;
            node.next = node;
        }

    }

    public Node findNodeByID(long l)
    {
        Node node = cache[(int)(l & (long)(size - 1))];
        for(Node node_1 = node.prev; node_1 != node; node_1 = node_1.prev)
            if(node_1.id == l)
                return node_1;

        return null;
    }

    public void removeFromCache(Node node, long l, byte byte0)
    {
        try
        {
            if(node.next != null)
                node.unlink();
            Node node_1 = cache[(int)(l & (long)(size - 1))];
            if(byte0 != 7)
            {
                return;
            } else
            {
                node.next = node_1.next;
                node.prev = node_1;
                node.next.prev = node;
                node.prev.next = node;
                node.id = l;
                return;
            }
        }
        catch(RuntimeException runtimeexception)
        {
            signlink.reporterror("91499, " + node + ", " + l + ", " + byte0 + ", " + runtimeexception.toString());
        }
        throw new RuntimeException();
    }

    private int size;
    private Node[] cache;
}
