/** * Node of a linked list. * * @author Franck van Breugel */ public class Node { private String element; private Node next; /** * Initializes this node with the given element and next node. * * @param element the element of this node. * @param next the next node. */ public Node(String element, Node next) { super(); this.element = element; this.next = next; } /** * Returns the element of this node. * * @return the element of this node. */ public String getElement() { return this.element; } /** * Sets the element of this node to the given element. * * @param element the new element of this node. */ public void setElement(String element) { this.element = element; } /** * Returns the node next to this node. * * @return the node next to this node. */ public Node getNext() { return this.next; } /** * Sets the node next to this node to the given node. * * @param next the new node next to this node. */ public void setNext(Node next) { this.next = next; } }