217 |
|
/** |
218 |
|
* Adds the specified element to the tail of this queue, waiting if |
219 |
|
* necessary for space to become available. |
220 |
+ |
* @param o the element to add |
221 |
+ |
* @throws InterruptedException if interrupted while waiting. |
222 |
|
* @throws NullPointerException if the specified element is <tt>null</tt>. |
223 |
|
*/ |
224 |
|
public void put(E o) throws InterruptedException { |
258 |
|
/** |
259 |
|
* Inserts the specified element at the tail of this queue, waiting if |
260 |
|
* necessary up to the specified wait time for space to become available. |
261 |
+ |
* @param o the element to add |
262 |
+ |
* @param timeout how long to wait before giving up, in units of |
263 |
+ |
* <tt>unit</tt> |
264 |
+ |
* @param unit a <tt>TimeUnit</tt> determining how to interpret the |
265 |
+ |
* <tt>timeout</tt> parameter |
266 |
+ |
* @return <tt>true</tt> if successful, or <tt>false</tt> if |
267 |
+ |
* the specified waiting time elapses before space is available. |
268 |
+ |
* @throws InterruptedException if interrupted while waiting. |
269 |
|
* @throws NullPointerException if the specified element is <tt>null</tt>. |
270 |
|
*/ |
271 |
|
public boolean offer(E o, long timeout, TimeUnit unit) |
301 |
|
return true; |
302 |
|
} |
303 |
|
|
304 |
< |
/** |
305 |
< |
* Inserts the specified element at the tail of this queue if possible, |
306 |
< |
* returning immediately if this queue is full. |
307 |
< |
* |
308 |
< |
* @throws NullPointerException if the specified element is <tt>null</tt> |
309 |
< |
*/ |
304 |
> |
/** |
305 |
> |
* Inserts the specified element at the tail of this queue if possible, |
306 |
> |
* returning immediately if this queue is full. |
307 |
> |
* |
308 |
> |
* @param o the element to add. |
309 |
> |
* @return <tt>true</tt> if it was possible to add the element to |
310 |
> |
* this queue, else <tt>false</tt> |
311 |
> |
* @throws NullPointerException if the specified element is <tt>null</tt> |
312 |
> |
*/ |
313 |
|
public boolean offer(E o) { |
314 |
|
if (o == null) throw new NullPointerException(); |
315 |
|
if (count.get() == capacity) |