|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<E>
java.util.AbstractQueue<E>
E - the type of the element in the collection.public abstract class AbstractQueue<E>
An abstract class which gives out skeletal implementations for some methods in Queue which include add, remove, and element that are based on offer, poll, and peek except that they throw exception to indicate the occurrence of some error instead of the return value of false or null.
| Constructor Summary | |
|---|---|
protected |
AbstractQueue()
Constructor for the sub classes. |
| Method Summary | |
|---|---|
boolean |
add(E o)
Adds an element to the queue. |
boolean |
addAll(Collection<? extends E> c)
Adds all the elements of a collection to the queue. |
void |
clear()
Removes all elements of the queue. |
E |
element()
Gets but not removes the element in the head of the queue. |
E |
remove()
Gets and removes the element in the head of the queue. |
| Methods inherited from class java.util.AbstractCollection |
|---|
contains, containsAll, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface java.util.Queue |
|---|
offer, peek, poll |
| Methods inherited from interface java.util.Collection |
|---|
contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray |
| Constructor Detail |
|---|
protected AbstractQueue()
| Method Detail |
|---|
public boolean add(E o)
add in interface Collection<E>add in class AbstractCollection<E>o - the element added to the queue.
NullPointerException - if the element is null.
IllegalStateException - if the element is not allowed to be added
to the queue.public boolean addAll(Collection<? extends E> c)
addAll in interface Collection<E>addAll in class AbstractCollection<E>c - the collection to be added to the queue.
NullPointerException - if the collection or any element of it is
null.
IllegalArgumentException - If the collection to be added to the
queue is the queue itself.public E remove()
remove in interface Queue<E>NoSuchElementException - if the queue is empty.public E element()
element in interface Queue<E>NoSuchElementException - if the queue is empty.public void clear()
clear in interface Collection<E>clear in class AbstractCollection<E>Collection.isEmpty(),
Collection.size()
|
Build 1.0_r1(from source) | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||