diff options
| author | schneefux <schneefux+commit@schneefux.xyz> | 2018-09-29 21:30:09 +0200 |
|---|---|---|
| committer | schneefux <schneefux+commit@schneefux.xyz> | 2018-09-29 21:30:09 +0200 |
| commit | 09e85e9945dc39705daba2af992283d0ceb59146 (patch) | |
| tree | 7321004f76deec01d9edd89b36e2b603e4c30f9f /src/de/ostfalia/algo/ws18/s1/LinkedListNode.java | |
| download | autoopstest-master.tar.gz autoopstest-master.zip | |
Diffstat (limited to 'src/de/ostfalia/algo/ws18/s1/LinkedListNode.java')
| -rw-r--r-- | src/de/ostfalia/algo/ws18/s1/LinkedListNode.java | 63 |
1 files changed, 63 insertions, 0 deletions
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 <E> The type of the value this node contains. + */ +public class LinkedListNode<E> { + /** + * This node's value. + */ + private E value; + /** + * The next linked node. + */ + private LinkedListNode<E> 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<E> getNext() { + return this.next; + } + + /** + * Set the next linked node. + * + * @param next + */ + public void setNext(LinkedListNode<E> next) { + this.next = next; + } +} |
