diff --git a/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/Node.java b/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/Node.java index f653853e..240e461f 100644 --- a/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/Node.java +++ b/mnemonic-benches/mnemonic-sort-bench/src/main/java/org/apache/mnemonic/bench/Node.java @@ -17,30 +17,62 @@ package org.apache.mnemonic.bench; +/** + * Represents a node in a linked list. + * + * @param the type of data stored in the node + */ public class Node { - T data; - Node nextNode; - - public Node(T data) { - this.data = data; - this.nextNode = null; - } - - public Node(T data, Node node) { - this.data = data; - this.nextNode = node; - } - - public T getData() { - return this.data; - } - - public void setNext(Node node) { - this.nextNode = node; - } - - public Node getNext() { - return this.nextNode; - } + private T data; // The data stored in the node + private Node nextNode; // Reference to the next node in the list + + /** + * Constructs a new node with the given data. + * + * @param data the data to be stored in the node + */ + public Node(T data) { + this.data = data; + this.nextNode = null; + } + + /** + * Constructs a new node with the given data and reference to the next node. + * + * @param data the data to be stored in the node + * @param nextNode the next node in the list + */ + public Node(T data, Node nextNode) { + this.data = data; + this.nextNode = nextNode; + } + + /** + * Gets the data stored in the node. + * + * @return the data stored in the node + */ + public T getData() { + return this.data; + } + + /** + * Sets the reference to the next node. + * + * @param nextNode the next node in the list + */ + public void setNext(Node nextNode) { + this.nextNode = nextNode; + } + + /** + * Gets the next node in the list. + * + * @return the next node in the list + */ + public Node getNext() { + return this.nextNode; + } } +