From 09e85e9945dc39705daba2af992283d0ceb59146 Mon Sep 17 00:00:00 2001 From: schneefux Date: Sat, 29 Sep 2018 21:30:09 +0200 Subject: test --- src/de/ostfalia/algo/ws18/s1/LinkedListNode.java | 63 ++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 src/de/ostfalia/algo/ws18/s1/LinkedListNode.java (limited to 'src/de/ostfalia/algo/ws18/s1/LinkedListNode.java') diff --git a/src/de/ostfalia/algo/ws18/s1/LinkedListNode.java b/src/de/ostfalia/algo/ws18/s1/LinkedListNode.java new file mode 100644 index 0000000..a7cf4f1 --- /dev/null +++ b/src/de/ostfalia/algo/ws18/s1/LinkedListNode.java @@ -0,0 +1,63 @@ +package de.ostfalia.algo.ws18.s1; + +/** + * A generic linked list node. + * + * @param The type of the value this node contains. + */ +public class LinkedListNode { + /** + * This node's value. + */ + private E value; + /** + * The next linked node. + */ + private LinkedListNode next; + + /** + * Create a node with the given value and no next node. + * + * @param value This node's value. + */ + public LinkedListNode(E value) { + this.value = value; + this.next = null; + } + + /** + * Get this node's value. + * + * @return This node's value. + */ + public E getValue() { + return this.value; + } + + /** + * Set this node's value. + * + * @param value The new value. + */ + public void setValue(E value) { + this.value = value; + } + + /** + * Get the next linked node. + * + * @return The next linked node. + */ + public LinkedListNode getNext() { + return this.next; + } + + /** + * Set the next linked node. + * + * @param next + */ + public void setNext(LinkedListNode next) { + this.next = next; + } +} -- cgit v1.3.1