|
|
@@ -33,7 +33,7 @@ public class ChainQueue<E> implements Queue<E> { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
Node<E> node; |
|
|
|
Node<E> node; // first item |
|
|
|
|
|
|
|
@Override |
|
|
|
public boolean add(E input) { // Übergeben der "Data" |
|
|
@@ -144,7 +144,12 @@ public class ChainQueue<E> implements Queue<E> { |
|
|
|
|
|
|
|
@Override |
|
|
|
public E poll() { |
|
|
|
return null; |
|
|
|
E temp = null; |
|
|
|
if (!this.isEmpty()) { |
|
|
|
temp = node.getData(); |
|
|
|
node = node.getNext(); |
|
|
|
} |
|
|
|
return temp; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
@@ -154,6 +159,9 @@ public class ChainQueue<E> implements Queue<E> { |
|
|
|
|
|
|
|
@Override |
|
|
|
public E peek() { |
|
|
|
if (!this.isEmpty()) { |
|
|
|
return node.getData(); |
|
|
|
} |
|
|
|
return null; |
|
|
|
} |
|
|
|
|