delayqueue.html

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

HTML
774
字号
</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><A HREF="DelayQueue.html#offer(E)">offer</A></B>(<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A>&nbsp;o)</CODE><BR>&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><A HREF="DelayQueue.html#offer(E, long, java.util.concurrent.TimeUnit)">offer</A></B>(<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A>&nbsp;o,      long&nbsp;timeout,      <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&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;<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#peek()">peek</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检索但不移除此队列的头部,如果此队列不存在未到期延迟的元素,则返回 <tt>null</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#poll()">poll</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;检索并移除此队列的头部,如果此队列不存在未到期延迟的元素,则返回 <tt>null</tt>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#poll(long, java.util.concurrent.TimeUnit)">poll</A></B>(long&nbsp;timeout,     <A HREF="TimeUnit.html" title="java.util.concurrent 中的枚举">TimeUnit</A>&nbsp;unit)</CODE><BR>&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;void</CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#put(E)">put</A></B>(<A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A>&nbsp;o)</CODE><BR>&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><A HREF="DelayQueue.html#remainingCapacity()">remainingCapacity</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;因为 <tt>DelayQueue</tt> 没有容量限制,所以它总是返回 <tt>Integer.MAX_VALUE</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><A HREF="DelayQueue.html#remove(java.lang.Object)">remove</A></B>(<A HREF="../../lang/Object.html" title="java.lang 中的类">Object</A>&nbsp;o)</CODE><BR>&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><A HREF="DelayQueue.html#size()">size</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="DelayQueue.html" title="DelayQueue 中的类型参数">E</A></CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#take()">take</A></B>()</CODE><BR>&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;<A HREF="../../lang/Object.html" title="java.lang 中的类">Object</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#toArray()">toArray</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><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="0" SUMMARY=""><TR ALIGN="right" VALIGN=""><TD NOWRAP><FONT SIZE="-1"><CODE>&lt;T&gt; T[]</CODE></FONT></TD></TR></TABLE></CODE></FONT></TD><TD><CODE><B><A HREF="DelayQueue.html#toArray(T[])">toArray</A></B>(T[]&nbsp;array)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回包含此 collection 中所有元素的数组;返回数组的运行时类型是指定数组的类型。</TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.util.AbstractQueue"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.util.<A HREF="../AbstractQueue.html" title="java.util 中的类">AbstractQueue</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../AbstractQueue.html#addAll(java.util.Collection)">addAll</A>, <A HREF="../AbstractQueue.html#element()">element</A>, <A HREF="../AbstractQueue.html#remove()">remove</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.util.AbstractCollection"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.util.<A HREF="../AbstractCollection.html" title="java.util 中的类">AbstractCollection</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../AbstractCollection.html#contains(java.lang.Object)">contains</A>, <A HREF="../AbstractCollection.html#containsAll(java.util.Collection)">containsAll</A>, <A HREF="../AbstractCollection.html#isEmpty()">isEmpty</A>, <A HREF="../AbstractCollection.html#removeAll(java.util.Collection)">removeAll</A>, <A HREF="../AbstractCollection.html#retainAll(java.util.Collection)">retainAll</A>, <A HREF="../AbstractCollection.html#toString()">toString</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从类 java.lang.<A HREF="../../lang/Object.html" title="java.lang 中的类">Object</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../lang/Object.html#clone()">clone</A>, <A HREF="../../lang/Object.html#equals(java.lang.Object)">equals</A>, <A HREF="../../lang/Object.html#finalize()">finalize</A>, <A HREF="../../lang/Object.html#getClass()">getClass</A>, <A HREF="../../lang/Object.html#hashCode()">hashCode</A>, <A HREF="../../lang/Object.html#notify()">notify</A>, <A HREF="../../lang/Object.html#notifyAll()">notifyAll</A>, <A HREF="../../lang/Object.html#wait()">wait</A>, <A HREF="../../lang/Object.html#wait(long)">wait</A>, <A HREF="../../lang/Object.html#wait(long, int)">wait</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.util.Queue"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从接口 java.util.<A HREF="../Queue.html" title="java.util 中的接口">Queue</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../Queue.html#element()">element</A>, <A HREF="../Queue.html#remove()">remove</A></CODE></TD></TR></TABLE>&nbsp;<A NAME="methods_inherited_from_class_java.util.Collection"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TH ALIGN="left"><B>从接口 java.util.<A HREF="../Collection.html" title="java.util 中的接口">Collection</A> 继承的方法</B></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../Collection.html#addAll(java.util.Collection)">addAll</A>, <A HREF="../Collection.html#contains(java.lang.Object)">contains</A>, <A HREF="../Collection.html#containsAll(java.util.Collection)">containsAll</A>, <A HREF="../Collection.html#equals(java.lang.Object)">equals</A>, <A HREF="../Collection.html#hashCode()">hashCode</A>, <A HREF="../Collection.html#isEmpty()">isEmpty</A>, <A HREF="../Collection.html#removeAll(java.util.Collection)">removeAll</A>, <A HREF="../Collection.html#retainAll(java.util.Collection)">retainAll</A></CODE></TD></TR></TABLE>&nbsp;<P><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>构造方法详细信息</B></FONT></TH></TR></TABLE><A NAME="DelayQueue()"><!-- --></A><H3>DelayQueue</H3><PRE>public <B>DelayQueue</B>()</PRE><DL><DD>创建一个最初为空的新 <tt>DelayQueue</tt>。<P></DL><HR><A NAME="DelayQueue(java.util.Collection)"><!-- --></A><H3>DelayQueue</H3><PRE>public <B>DelayQueue</B>(<A HREF="../Collection.html" title="java.util 中的接口">Collection</A>&lt;? extends <A HREF="DelayQueue.html" title="DelayQueue 中的类型参数">E</A>&gt;&nbsp;c)</PRE><DL><DD>创建一个最初包含 <A HREF="Delayed.html" title="java.util.concurrent 中的接口"><CODE>Delayed</CODE></A> 实例的给定 collection 中的元素的 <tt>DelayQueue</tt>。<P><DL><DT><B>参数:</B><DD><CODE>c</CODE> - collection<DT><B>抛出:</B><DD><CODE><A HREF="../../lang/NullPointerException.html" title="java.lang 中的类">NullPointerException</A></CODE> - 如果 <tt>c</tt> 或者 collection 中的任何元素为 <tt>null</tt></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">

⌨️ 快捷键说明

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