protected void append(Link link) { link.prev = this; link.next = this.next; this.next = link; if (link.next != null) { link.next.prev = link; } }
protected void insert(Link link) { link.next = this; link.prev = this.prev; this.prev = link; if (link.prev != null) { link.prev.next = link; } }