442 |
|
addAll(c); |
443 |
|
} |
444 |
|
|
445 |
+ |
/** |
446 |
+ |
* @throws InterruptedException {@inheritDoc} |
447 |
+ |
* @throws NullPointerException {@inheritDoc} |
448 |
+ |
*/ |
449 |
|
public void put(E e) throws InterruptedException { |
450 |
|
if (e == null) throw new NullPointerException(); |
451 |
|
if (Thread.interrupted()) throw new InterruptedException(); |
452 |
|
xfer(e, NOWAIT, 0); |
453 |
|
} |
454 |
|
|
455 |
+ |
/** |
456 |
+ |
* @throws InterruptedException {@inheritDoc} |
457 |
+ |
* @throws NullPointerException {@inheritDoc} |
458 |
+ |
*/ |
459 |
|
public boolean offer(E e, long timeout, TimeUnit unit) |
460 |
|
throws InterruptedException { |
461 |
|
if (e == null) throw new NullPointerException(); |
464 |
|
return true; |
465 |
|
} |
466 |
|
|
467 |
+ |
/** |
468 |
+ |
* @throws NullPointerException {@inheritDoc} |
469 |
+ |
*/ |
470 |
|
public boolean offer(E e) { |
471 |
|
if (e == null) throw new NullPointerException(); |
472 |
|
xfer(e, NOWAIT, 0); |
473 |
|
return true; |
474 |
|
} |
475 |
|
|
476 |
+ |
/** |
477 |
+ |
* @throws NullPointerException {@inheritDoc} |
478 |
+ |
*/ |
479 |
|
public boolean add(E e) { |
480 |
|
if (e == null) throw new NullPointerException(); |
481 |
|
xfer(e, NOWAIT, 0); |
482 |
|
return true; |
483 |
|
} |
484 |
|
|
485 |
+ |
/** |
486 |
+ |
* @throws InterruptedException {@inheritDoc} |
487 |
+ |
* @throws NullPointerException {@inheritDoc} |
488 |
+ |
*/ |
489 |
|
public void transfer(E e) throws InterruptedException { |
490 |
|
if (e == null) throw new NullPointerException(); |
491 |
|
if (xfer(e, WAIT, 0) == null) { |
494 |
|
} |
495 |
|
} |
496 |
|
|
497 |
+ |
/** |
498 |
+ |
* @throws InterruptedException {@inheritDoc} |
499 |
+ |
* @throws NullPointerException {@inheritDoc} |
500 |
+ |
*/ |
501 |
|
public boolean tryTransfer(E e, long timeout, TimeUnit unit) |
502 |
|
throws InterruptedException { |
503 |
|
if (e == null) throw new NullPointerException(); |
508 |
|
throw new InterruptedException(); |
509 |
|
} |
510 |
|
|
511 |
+ |
/** |
512 |
+ |
* @throws NullPointerException {@inheritDoc} |
513 |
+ |
*/ |
514 |
|
public boolean tryTransfer(E e) { |
515 |
|
if (e == null) throw new NullPointerException(); |
516 |
|
return fulfill(e) != null; |
517 |
|
} |
518 |
|
|
519 |
+ |
/** |
520 |
+ |
* @throws InterruptedException {@inheritDoc} |
521 |
+ |
*/ |
522 |
|
public E take() throws InterruptedException { |
523 |
|
Object e = xfer(null, WAIT, 0); |
524 |
|
if (e != null) |
527 |
|
throw new InterruptedException(); |
528 |
|
} |
529 |
|
|
530 |
+ |
/** |
531 |
+ |
* @throws InterruptedException {@inheritDoc} |
532 |
+ |
*/ |
533 |
|
public E poll(long timeout, TimeUnit unit) throws InterruptedException { |
534 |
|
Object e = xfer(null, TIMEOUT, unit.toNanos(timeout)); |
535 |
|
if (e != null || !Thread.interrupted()) |
541 |
|
return fulfill(null); |
542 |
|
} |
543 |
|
|
544 |
+ |
/** |
545 |
+ |
* @throws NullPointerException {@inheritDoc} |
546 |
+ |
* @throwsIllegalArgumentException {@inheritDoc} |
547 |
+ |
*/ |
548 |
|
public int drainTo(Collection<? super E> c) { |
549 |
|
if (c == null) |
550 |
|
throw new NullPointerException(); |
559 |
|
return n; |
560 |
|
} |
561 |
|
|
562 |
+ |
/** |
563 |
+ |
* @throws NullPointerException {@inheritDoc} |
564 |
+ |
* @throwsIllegalArgumentException {@inheritDoc} |
565 |
+ |
*/ |
566 |
|
public int drainTo(Collection<? super E> c, int maxElements) { |
567 |
|
if (c == null) |
568 |
|
throw new NullPointerException(); |