public Linkable popFront() { Linkable next = tail.next; if (next == tail) { return(null); } next.unlink(); return(next); }
public void pushFront(Linkable item) { if (item.previous != null) { item.unlink(); } item.previous = tail; item.next = tail.next; item.previous.next = item; item.next.previous = item; }
public void put(long key, Linkable item) { if (item.previous != null) { item.unlink(); } Linkable current = entries[(int)(key & size - 1)]; item.previous = current.previous; item.next = current; item.previous.next = item; item.next.previous = item; item.id = key; }
public void clear() { if (tail.next == tail) { return; } while (true) { Linkable next = tail.next; if (next == tail) { return; } next.unlink(); } }