collection.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 1,104 行 · 第 1/5 页

HTML
1,104
字号
<TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="../Vector.html#Vector(java.util.Collection)">Vector</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="../Vector.html" title="Vector 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;构造一个包含指定集合中的元素的向量,这些元素按其集合的迭代器返回元素的顺序排列。</TD></TR></TABLE>&nbsp;<P><A NAME="java.util.concurrent"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><A HREF="../concurrent/package-summary.html">java.util.concurrent</A> 中 <A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 的使用</FONT></TH></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2"><A HREF="../concurrent/package-summary.html">java.util.concurrent</A> 中 <A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 的子接口</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;interface</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">BlockingQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支持两个附加操作的 <A HREF="../Queue.html" title="java.util 中的接口"><CODE>Queue</CODE></A>,这两个操作是:检索元素时等待队列变为非空,以及存储元素时等待空间变得可用。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">实现 <A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 的 <A HREF="../concurrent/package-summary.html">java.util.concurrent</A> 中的类</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/ArrayBlockingQueue.html" title="java.util.concurrent 中的类">ArrayBlockingQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个由数组支持的有界<A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">阻塞队列</A>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/ConcurrentLinkedQueue.html" title="java.util.concurrent 中的类">ConcurrentLinkedQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个基于链接节点的、无界的、线程安全的<A HREF="../Queue.html" title="java.util 中的接口">队列</A>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/CopyOnWriteArrayList.html" title="java.util.concurrent 中的类">CopyOnWriteArrayList&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<A HREF="../ArrayList.html" title="java.util 中的类"><CODE>ArrayList</CODE></A> 的一个线程安全的变体,其中所有可变操作(添加、设置,等等)都是通过对基础数组进行一次新的复制来实现的。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/CopyOnWriteArraySet.html" title="java.util.concurrent 中的类">CopyOnWriteArraySet&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;对其所有操作使用 <A HREF="../concurrent/CopyOnWriteArrayList.html" title="java.util.concurrent 中的类"><CODE>CopyOnWriteArrayList</CODE></A> 的 <A HREF="../Set.html" title="java.util 中的接口"><CODE>Set</CODE></A>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/DelayQueue.html" title="java.util.concurrent 中的类">DelayQueue&lt;E extends Delayed&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<tt>Delayed</tt> 元素的一个无界<A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">阻塞队列</A>,只有在延迟期满时才能从中提取元素。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/LinkedBlockingQueue.html" title="java.util.concurrent 中的类">LinkedBlockingQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个基于已链接节点的、范围任意的 <A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">blocking queue</A>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/PriorityBlockingQueue.html" title="java.util.concurrent 中的类">PriorityBlockingQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一个无界的<A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">阻塞队列</A>,它使用与类 <A HREF="../PriorityQueue.html" title="java.util 中的类"><CODE>PriorityQueue</CODE></A> 相同的顺序规则,并且提供了阻塞检索的操作。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;class</CODE></FONT></TD><TD><CODE><B><A HREF="../concurrent/SynchronousQueue.html" title="java.util.concurrent 中的类">SynchronousQueue&lt;E&gt;</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;一种<A HREF="../concurrent/BlockingQueue.html" title="java.util.concurrent 中的接口">阻塞队列</A>,其中每个 <tt>put</tt> 必须等待一个 <tt>take</tt>,反之亦然。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">返回 <A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 的 <A HREF="../concurrent/package-summary.html">java.util.concurrent</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../../lang/Thread.html" title="java.lang 中的类">Thread</A>&gt;</CODE></FONT></TD><TD><CODE><B>Semaphore.</B><B><A HREF="../concurrent/Semaphore.html#getQueuedThreads()">getQueuedThreads</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个 collection,包含可能等待获取的线程。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;<A HREF="../concurrent/ConcurrentHashMap.html" title="ConcurrentHashMap 中的类型参数">V</A>&gt;</CODE></FONT></TD><TD><CODE><B>ConcurrentHashMap.</B><B><A HREF="../concurrent/ConcurrentHashMap.html#values()">values</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此映射中包含的值的 collection 视图。</TD></TR></TABLE>&nbsp;<P><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor"><TH ALIGN="left" COLSPAN="2">参数类型为 <A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 的 <A HREF="../concurrent/package-summary.html">java.util.concurrent</A> 中的方法</FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArraySet.</B><B><A HREF="../concurrent/CopyOnWriteArraySet.html#addAll(java.util.Collection)">addAll</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="../concurrent/CopyOnWriteArraySet.html" title="CopyOnWriteArraySet 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArrayList.</B><B><A HREF="../concurrent/CopyOnWriteArrayList.html#addAll(java.util.Collection)">addAll</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="../concurrent/CopyOnWriteArrayList.html" title="CopyOnWriteArrayList 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;按照指定 Collection 的迭代器返回元素的顺序,将指定 Collection 中的所有元素追加此列表的尾部。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArrayList.</B><B><A HREF="../concurrent/CopyOnWriteArrayList.html#addAll(int, java.util.Collection)">addAll</A></B>(int&nbsp;index,       <A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="../concurrent/CopyOnWriteArrayList.html" title="CopyOnWriteArrayList 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;从指定位置开始,将指定 Collection 的所有元素插入此列表。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArrayList.</B><B><A HREF="../concurrent/CopyOnWriteArrayList.html#addAllAbsent(java.util.Collection)">addAllAbsent</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="../concurrent/CopyOnWriteArrayList.html" title="CopyOnWriteArrayList 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;按照指定 Collection 的迭代器返回元素的顺序,将指定 Collection 中尚未包含在此列表中的所有元素追加列表的尾部。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>SynchronousQueue.</B><B><A HREF="../concurrent/SynchronousQueue.html#containsAll(java.util.Collection)">containsAll</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;?&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;除非给定集合为空,否则返回 <tt>false</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArraySet.</B><B><A HREF="../concurrent/CopyOnWriteArraySet.html#containsAll(java.util.Collection)">containsAll</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;?&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B>CopyOnWriteArrayList.</B><B><A HREF="../concurrent/CopyOnWriteArrayList.html#containsAll(java.util.Collection)">containsAll</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;?&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果此 collection 包含指定 collection 的所有元素,则返回 ture。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>SynchronousQueue.</B><B><A HREF="../concurrent/SynchronousQueue.html#drainTo(java.util.Collection)">drainTo</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? super <A HREF="../concurrent/SynchronousQueue.html" title="SynchronousQueue 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>PriorityBlockingQueue.</B><B><A HREF="../concurrent/PriorityBlockingQueue.html#drainTo(java.util.Collection)">drainTo</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? super <A HREF="../concurrent/PriorityBlockingQueue.html" title="PriorityBlockingQueue 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>LinkedBlockingQueue.</B><B><A HREF="../concurrent/LinkedBlockingQueue.html#drainTo(java.util.Collection)">drainTo</A></B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? super <A HREF="../concurrent/LinkedBlockingQueue.html" title="LinkedBlockingQueue 中的类型参数">E</A>&gt;&nbsp;c)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B>DelayQueue.</B><B><A HREF="../concurrent/DelayQueue.html#drainTo(java.util.Collection)">drainTo</A></B

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?