--- jsr166/src/main/java/util/AbstractQueue.java 2003/06/23 02:26:15 1.3
+++ jsr166/src/main/java/util/AbstractQueue.java 2003/07/28 16:00:19 1.7
@@ -12,8 +12,10 @@ package java.util;
* exceptions instead of indicating failure via false or null returns.
* The provided implementations all assume that the base implementation
* does not allow null elements.
+ * @since 1.5
+ * @author Doug Lea
*/
-
+
public abstract class AbstractQueue extends AbstractCollection implements Queue {
public boolean add(E x) {
@@ -23,7 +25,7 @@ public abstract class AbstractQueue e
throw new IllegalStateException("Queue full");
}
- public E remove() {
+ public E remove() throws NoSuchElementException {
E x = poll();
if (x != null)
return x;
@@ -31,7 +33,7 @@ public abstract class AbstractQueue e
throw new NoSuchElementException();
}
- public E element() {
+ public E element() throws NoSuchElementException {
E x = peek();
if (x != null)
return x;
@@ -44,4 +46,11 @@ public abstract class AbstractQueue e
;
}
+ // XXX Remove this redundant declaration, pending response from Neal Gafter.
+ public abstract Iterator iterator();
}
+
+
+
+
+