224 |
|
} |
225 |
|
|
226 |
|
/** |
227 |
< |
* Adds the specified element to the tail of this queue, waiting if |
227 |
> |
* Inserts the specified element at the tail of this queue, waiting if |
228 |
|
* necessary for space to become available. |
229 |
|
* |
230 |
|
* @throws InterruptedException {@inheritDoc} |
311 |
|
} |
312 |
|
|
313 |
|
/** |
314 |
< |
* Inserts the specified element at the tail of this queue if possible, |
315 |
< |
* returning immediately if this queue is full. |
314 |
> |
* Inserts the specified element at the tail of this queue if it is |
315 |
> |
* possible to do so immediately without exceeding the queue's capacity, |
316 |
> |
* returning <tt>true</tt> upon success and <tt>false</tt> if this queue |
317 |
> |
* is full. |
318 |
> |
* When using a capacity-restricted queue, this method is generally |
319 |
> |
* preferable to method {@link BlockingQueue#add add}, which can fail to |
320 |
> |
* insert an element only by throwing an exception. |
321 |
|
* |
317 |
– |
* @return <tt>true</tt> if it was possible to add the element to |
318 |
– |
* this queue, else <tt>false</tt> |
322 |
|
* @throws NullPointerException if the specified element is null |
323 |
|
*/ |
324 |
|
public boolean offer(E e) { |
446 |
|
} |
447 |
|
|
448 |
|
/** |
449 |
< |
* Removes a single instance of the specified element from this |
450 |
< |
* queue, if it is present. |
449 |
> |
* Removes a single instance of the specified element from this queue, |
450 |
> |
* if it is present. More formally, removes an element <tt>e</tt> such |
451 |
> |
* that <tt>o.equals(e)</tt>, if this queue contains one or more such |
452 |
> |
* elements. |
453 |
> |
* Returns <tt>true</tt> if this queue contained the specified element |
454 |
> |
* (or equivalently, if this queue changed as a result of the call). |
455 |
> |
* |
456 |
> |
* @param o element to be removed from this queue, if present |
457 |
> |
* @return <tt>true</tt> if this queue changed as a result of the call |
458 |
|
*/ |
459 |
|
public boolean remove(Object o) { |
460 |
|
if (o == null) return false; |