/* a class for nodes that store strings * @author Biagioni, Edoardo * @assignment lecture 8 * @date February 5, 2008 */ public class StringNode { /* two fields, the first to store the item itself, * the second is a pointer to the next node in the linked list. * If there is no next node, the pointer is null. */ private String item; private StringNode nextNode; /* constructor: * @param value, the value for the node * @param next, the next node in the linked list */ public StringNode(String value, StringNode next) { item = value; nextNode = next; } /* accessor methods */ public String getValue() { return item; } public StringNode getNext() { return nextNode; } /* mutator method */ public void setNext(StringNode newNext) { nextNode = newNext; } }