6 |
|
|
7 |
|
|
8 |
|
package java.util.concurrent; |
9 |
+ |
import java.util.concurrent.*; // for javadoc (till 6280605 is fixed) |
10 |
|
import java.util.concurrent.locks.*; |
11 |
|
import java.util.*; |
12 |
|
|
381 |
|
* precise control over the runtime type of the output array, and may, |
382 |
|
* under certain circumstances, be used to save allocation costs. |
383 |
|
* |
384 |
< |
* <p>Suppose <tt>x</tt> is a queue known to contain only strings. |
385 |
< |
* The following code can be used to dump the queue into a newly |
385 |
< |
* allocated array of <tt>String</tt>: |
384 |
> |
* <p>The following code can be used to dump a delay queue into a newly |
385 |
> |
* allocated array of <tt>Delayed</tt>: |
386 |
|
* |
387 |
|
* <pre> |
388 |
< |
* String[] y = x.toArray(new String[0]);</pre> |
388 |
> |
* Delayed[] a = q.toArray(new Delayed[0]);</pre> |
389 |
|
* |
390 |
|
* Note that <tt>toArray(new Object[0])</tt> is identical in function to |
391 |
|
* <tt>toArray()</tt>. |