5 |
|
*/ |
6 |
|
|
7 |
|
package java.util; |
8 |
+ |
import java.util.*; // for javadoc (till 6280605 is fixed) |
9 |
|
|
10 |
|
/** |
11 |
|
* This class provides skeletal implementations of some {@link Queue} |
54 |
|
* else throws an <tt>IllegalStateException</tt>. |
55 |
|
* |
56 |
|
* @param e the element to add |
57 |
< |
* @return <tt>true</tt> (as per the spec for {@link Collection#add}) |
57 |
> |
* @return <tt>true</tt> (as specified by {@link Collection#add}) |
58 |
|
* @throws IllegalStateException if the element cannot be added at this |
59 |
|
* time due to capacity restrictions |
59 |
– |
* @throws NullPointerException if the specified element is null and |
60 |
– |
* this queue not permit null elements |
60 |
|
* @throws ClassCastException if the class of the specified element |
61 |
|
* prevents it from being added to this queue |
62 |
+ |
* @throws NullPointerException if the specified element is null and |
63 |
+ |
* this queue not permit null elements |
64 |
|
* @throws IllegalArgumentException if some property of this element |
65 |
|
* prevents it from being added to this queue |
66 |
|
*/ |
73 |
|
|
74 |
|
/** |
75 |
|
* Retrieves and removes the head of this queue. This method differs |
76 |
< |
* from {@link #poll} only in that it throws an exception if this queue |
77 |
< |
* is empty. |
76 |
> |
* from {@link #poll poll} only in that it throws an exception if this |
77 |
> |
* queue is empty. |
78 |
|
* |
79 |
|
* <p>This implementation returns the result of <tt>poll</tt> |
80 |
|
* unless the queue is empty. |
92 |
|
|
93 |
|
/** |
94 |
|
* Retrieves, but does not remove, the head of this queue. This method |
95 |
< |
* differs from {@link #peek} only in that it throws an exception if |
95 |
> |
* differs from {@link #peek peek} only in that it throws an exception if |
96 |
|
* this queue is empty. |
97 |
|
* |
98 |
|
* <p>This implementation returns the result of <tt>peek</tt> |
136 |
|
* having been successfully added when the associated exception is |
137 |
|
* thrown. |
138 |
|
* |
139 |
< |
* @param c collection whose elements are to be added to this queue |
139 |
> |
* @param c collection containing elements to be added to this queue |
140 |
|
* @return <tt>true</tt> if this queue changed as a result of the call |
141 |
+ |
* @throws ClassCastException if the class of an element of the specified |
142 |
+ |
* collection prevents it from being added to this queue |
143 |
|
* @throws NullPointerException if the specified collection contains a |
144 |
|
* null element and this queue does not permit null elements, |
145 |
|
* or if the specified collection is null |
143 |
– |
* @throws ClassCastException if the class of an element of the specified |
144 |
– |
* collection prevents it from being added to this queue |
146 |
|
* @throws IllegalArgumentException if some property of an element of the |
147 |
< |
* specified collection prevents it from being added to this |
148 |
< |
* queue, or if the specified collection is this queue |
147 |
> |
* specified collection prevents it from being added to this |
148 |
> |
* queue, or if the specified collection is this queue |
149 |
|
* @throws IllegalStateException if not all the elements can be added at |
150 |
|
* this time due to insertion restrictions |
151 |
|
* @see #add(Object) |