/** * A node in the ContactList linked list **/ public class ContactNode{ /** * The data of the node **/ private ContactEntry data; /** * The next node after this one **/ private ContactNode next; /** * Constructor that sets each instance variable to the corresponding incoming parameter. * @param data the data of the node **/ ContactNode(ContactEntry data){ this.data = data; this.next = null; } /** * Constructor that sets each instance variable to the corresponding incoming parameter. * @param data the data of the node * @param next **/ ContactNode(ContactEntry data, ContactNode next){ this.data = data; this.next = next; } /** * Sets the data of the node to the incoming ContactEntry * @param data the data of node **/ public void setData(ContactEntry data){ this.data = data; } /** * Sets the next node to the incoming ContactNode * @param next the next node **/ public void setNext(ContactNode next){ this.next = next; } /** * Returns the data of the node * @return the data of the node **/ public ContactEntry getData(){ return data; } /** * Returns the next node * @return the next node **/ public ContactNode getNext(){ return next; } /** * Method to return a String representation of the node's contact information * @return a String representation of the contact's information **/ public String toString(){ return data.toString(); } }