Methods Summary |
---|
public boolean | add(E o)Adds an element to the queue.
if (null == o) {
throw new NullPointerException();
}
if (offer(o)) {
return true;
}
throw new IllegalStateException();
|
public boolean | addAll(java.util.Collection c)Adds all the elements of a collection to the queue. If the collection is
the queue itself, then an IllegalArgumentException will be thrown. If
during the process, some runtime exception is thrown, then those elements
in the collection which have already successfully been added will remain
in the queue. The result of the method is undefined if the collection is
modified during the process of the method.
if (null == c) {
throw new NullPointerException();
}
if (this == c) {
throw new IllegalArgumentException();
}
return super.addAll(c);
|
public void | clear()Removes all elements of the queue, leaving it empty.
E o;
do {
o = poll();
} while (null != o);
|
public E | element()Returns but does not remove the element at the head of the queue.
E o = peek();
if (null == o) {
throw new NoSuchElementException();
}
return o;
|
public E | remove()Removes the element at the head of the queue and returns it.
E o = poll();
if (null == o) {
throw new NoSuchElementException();
}
return o;
|