/* Link2.java ** An instance of this utility class is an object containing a data item ** (of the reference type used in instantiating the generic type parameter) ** and links to two other objects of this class. */ public class Link2 { // instance variables // ------------------ public T item; public Link2 prev, next; // constructors // ------------ public Link2(T item, Link2 prev, Link2 next) { setItem(item); setPrev(prev); setNext(next); } public Link2(T item) { this(item, null, null); } public void setItem(T item) { this.item = item; } public void setPrev(Link2 prev) { this.prev = prev; } public void setNext(Link2 next) { this.next = next; } }