diff --git a/src/ChainQueue.java b/src/ChainQueue.java index 6337a41..dec4f0b 100644 --- a/src/ChainQueue.java +++ b/src/ChainQueue.java @@ -1,12 +1,15 @@ +/************************************************ + * Name: David Wurm + * Datum: 25.11.2019 + * Klasse: 3AHIF + * Programm: HUE_06_GenericsQueue + ************************************************/ import java.util.Collection; import java.util.Iterator; import java.util.Queue; - public class ChainQueue implements Queue { - private class Node { - private E data; private Node next; @@ -30,7 +33,6 @@ public class ChainQueue implements Queue { this.data = data; } - } Node first; // first item of the queue @@ -42,7 +44,6 @@ public class ChainQueue implements Queue { return true; } return addNode(input, first); // no? -> goto addNode() - } private boolean addNode(E input, Node n) { // run through the queue and find the first "place" which is empty @@ -51,7 +52,6 @@ public class ChainQueue implements Queue { return true; } return addNode(input, n.getNext()); - } @Override diff --git a/src/HUE_06_Generics.java b/src/HUE_06_Generics.java index e25cb38..dea3e18 100644 --- a/src/HUE_06_Generics.java +++ b/src/HUE_06_Generics.java @@ -1,5 +1,10 @@ +/************************************************ + * Name: David Wurm + * Datum: 25.11.2019 + * Klasse: 3AHIF + * Programm: HUE_06_GenericsQueue + ************************************************/ import java.util.Queue; - public class HUE_06_Generics { public static void main(String[] args) { Queue strs = new ChainQueue(); @@ -14,6 +19,5 @@ public class HUE_06_Generics { System.out.println(" - " + strs.poll() + " #" + strs.size()); System.out.println(" - " + strs.poll() + " #" + strs.size()); System.out.println(" - " + strs.poll() + " #" + strs.size()); - } }