package DevUtils.Nodes; /** * Simple Node implementation that holds * a reference to the next Node. * * @param The type of the data held in the Node. * * @author aitorfi */ public class SimpleNode extends Node { /** Reference to the next Node. */ private SimpleNode nextNode; /** Empty contructor. */ public SimpleNode() { super(); } /** * Initializes the Nodes' data. * * @param data Value to which data will be initialized. * @see Node#Node(Object) */ public SimpleNode(E data) { super(data); } /** * Initializes the Nodes' data and next node reference. * * @param data Value to which data will be initialized. * @param nextNode Value to which the next node reference will be set. */ public SimpleNode(E data, SimpleNode nextNode) { super(data); this.nextNode = nextNode; } /** * @return True if there is a next node, otherwise false. */ public boolean hasNext() { return (nextNode != null); } public SimpleNode getNextNode() { return nextNode; } public void setNextNode(SimpleNode nextNode) { this.nextNode = nextNode; } }